]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
- add tests for unique and quote flag on create_index()
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 10 Oct 2014 18:05:09 +0000 (14:05 -0400)
committerLucas Taylor <ltaylor.volks@gmail.com>
Fri, 10 Oct 2014 19:23:05 +0000 (14:23 -0500)
tests/test_op.py

index 13e58bd4bb204667f4c76a1ea0d25112d913b5b6..c1e2eb45166bd19f4d9c6aad15e8ed714f99372f 100644 (file)
@@ -575,6 +575,20 @@ class OpTest(TestBase):
             "CREATE INDEX ik_test ON t1 (foo, bar)"
         )
 
+    def test_create_unique_index(self):
+        context = op_fixture()
+        op.create_index('ik_test', 't1', ['foo', 'bar'], unique=True)
+        context.assert_(
+            "CREATE UNIQUE INDEX ik_test ON t1 (foo, bar)"
+        )
+
+    def test_create_index_quote_flag(self):
+        context = op_fixture()
+        op.create_index('ik_test', 't1', ['foo', 'bar'], quote=True)
+        context.assert_(
+            'CREATE INDEX "ik_test" ON t1 (foo, bar)'
+        )
+
     def test_create_index_table_col_event(self):
         context = op_fixture()