diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_batch.py | 13 | ||||
-rw-r--r-- | tests/test_mssql.py | 6 | ||||
-rw-r--r-- | tests/test_mysql.py | 6 | ||||
-rw-r--r-- | tests/test_op.py | 22 |
4 files changed, 47 insertions, 0 deletions
diff --git a/tests/test_batch.py b/tests/test_batch.py index 66d59fd..5920cdf 100644 --- a/tests/test_batch.py +++ b/tests/test_batch.py @@ -1783,6 +1783,19 @@ class BatchRoundTripTest(TestBase): ck_consts = inspect(self.conn).get_check_constraints("ck_table") eq_(ck_consts, []) + @config.requirements.check_constraint_reflection + def test_drop_ck_constraint_legacy_type(self): + self._ck_constraint_fixture() + + with self.op.batch_alter_table( + "ck_table", recreate="always" + ) as batch_op: + # matches the docs that were written for this originally + batch_op.drop_constraint("ck", "check") + + ck_consts = inspect(self.conn).get_check_constraints("ck_table") + eq_(ck_consts, []) + @config.requirements.unnamed_constraints def test_drop_foreign_key(self): bar = Table( diff --git a/tests/test_mssql.py b/tests/test_mssql.py index b785e2f..693ab57 100644 --- a/tests/test_mssql.py +++ b/tests/test_mssql.py @@ -161,6 +161,12 @@ class OpTest(TestBase): op.drop_index("my_idx", table_name="my_table") context.assert_contains("DROP INDEX my_idx ON my_table") + def test_drop_index_w_tablename_legacy(self): + """#1243""" + context = op_fixture("mssql") + op.drop_index("my_idx", "my_table") + context.assert_contains("DROP INDEX my_idx ON my_table") + def test_drop_column_w_default(self): context = op_fixture("mssql") op.drop_column("t1", "c1", mssql_drop_default=True) diff --git a/tests/test_mysql.py b/tests/test_mysql.py index fd3b185..c3ac966 100644 --- a/tests/test_mysql.py +++ b/tests/test_mysql.py @@ -399,6 +399,12 @@ class MySQLOpTest(TestBase): op.drop_constraint("f1", "t1", type_="foreignkey") context.assert_("ALTER TABLE t1 DROP FOREIGN KEY f1") + def test_drop_fk_legacy(self): + """#1245""" + context = op_fixture("mysql") + op.drop_constraint("f1", "t1", "foreignkey") + context.assert_("ALTER TABLE t1 DROP FOREIGN KEY f1") + def test_drop_fk_quoted(self): context = op_fixture("mysql") op.drop_constraint("MyFk", "MyTable", type_="foreignkey") diff --git a/tests/test_op.py b/tests/test_op.py index 35adeaf..6aca753 100644 --- a/tests/test_op.py +++ b/tests/test_op.py @@ -806,6 +806,17 @@ class OpTest(TestBase): op.drop_constraint("foo_bar_bat", "t1") context.assert_("ALTER TABLE t1 DROP CONSTRAINT foo_bar_bat") + def test_drop_constraint_type(self): + context = op_fixture() + op.drop_constraint("foo_bar_bat", "t1", type_="foreignkey") + context.assert_("ALTER TABLE t1 DROP CONSTRAINT foo_bar_bat") + + def test_drop_constraint_legacy_type(self): + """#1245""" + context = op_fixture() + op.drop_constraint("foo_bar_bat", "t1", "foreignkey") + context.assert_("ALTER TABLE t1 DROP CONSTRAINT foo_bar_bat") + def test_drop_constraint_schema(self): context = op_fixture() op.drop_constraint("foo_bar_bat", "t1", schema="foo") @@ -856,6 +867,17 @@ class OpTest(TestBase): op.drop_index("ik_test") context.assert_("DROP INDEX ik_test") + def test_drop_index_w_tablename(self): + context = op_fixture() + op.drop_index("ik_test", table_name="the_table") + context.assert_("DROP INDEX ik_test") + + def test_drop_index_w_tablename_legacy(self): + """#1243""" + context = op_fixture() + op.drop_index("ik_test", "the_table") + context.assert_("DROP INDEX ik_test") + def test_drop_index_schema(self): context = op_fixture() op.drop_index("ik_test", schema="foo") |