]> 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)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 10 Oct 2014 18:05:09 +0000 (14:05 -0400)
tests/test_op.py

index 54349007c2435e69a0647c6487c752f107dc9cbf..8b94cd0cc76cbf49dda0eb30002fb35e9702ce66 100644 (file)
@@ -614,6 +614,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()