diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-07-19 12:01:50 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-07-19 12:01:50 -0400 |
commit | 873027160f88af277b73223e9fe33bfba315532f (patch) | |
tree | a7cd1d326be0e80011617f370b8b0cdd185fd330 /tests | |
parent | 54d5953be781b1d213557940c6f5960a8d1068dc (diff) | |
download | alembic-873027160f88af277b73223e9fe33bfba315532f.tar.gz |
add docs for naming convention bypass case
Change-Id: I8d604eaab7865466b8a7008693621c00f954397d
References: #453
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_op_naming_convention.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_op_naming_convention.py b/tests/test_op_naming_convention.py index 0cc22af..b0fa765 100644 --- a/tests/test_op_naming_convention.py +++ b/tests/test_op_naming_convention.py @@ -158,3 +158,23 @@ class AutoNamingConventionTest(TestBase): "ALTER TABLE t1 ADD COLUMN c1 BOOLEAN NOT NULL", "ALTER TABLE t1 ADD CONSTRAINT foo CHECK (c1 IN (0, 1))", ) + + def test_drop_check_constraint_plain(self): + context = op_fixture( + naming_convention={"ck": "ck_%(table_name)s_%(constraint_name)s"} + ) + + op.drop_constraint("foo_bar_bat", "t1", type_="check") + context.assert_("ALTER TABLE t1 DROP CONSTRAINT ck_t1_foo_bar_bat") + + def test_drop_check_constraint_opf(self): + context = op_fixture( + naming_convention={"ck": "ck_%(table_name)s_%(constraint_name)s"} + ) + + op.drop_constraint( + op.f("some_specific_foo_bar_bat"), "t1", type_="check" + ) + context.assert_( + "ALTER TABLE t1 DROP CONSTRAINT some_specific_foo_bar_bat" + ) |