From e6a5ea8fa7d10078c8d3f1bf6cabc4399cac3e70 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 29 Oct 2011 17:38:56 -0400 Subject: - [bug] Postgresql dialect memoizes that an ENUM of a particular name was processed during a create/drop sequence. This allows a create/drop sequence to work without any calls to "checkfirst", and also means with "checkfirst" turned on it only needs to check for the ENUM once. [ticket:2311] --- test/sql/test_types.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/sql') diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 50cb0ba06..987e97f9b 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -956,6 +956,20 @@ class EnumTest(fixtures.TestBase): {'id':4, 'someenum':'four'} ) + def test_mock_engine_no_prob(self): + """ensure no 'checkfirst' queries are run when enums + are created with checkfirst=False""" + + e = engines.mock_engine() + t = Table('t1', MetaData(), + Column('x', Enum("x", "y", name="pge")) + ) + t.create(e, checkfirst=False) + # basically looking for the start of + # the constraint, or the ENUM def itself, + # depending on backend. + assert "('x'," in e.print_sql() + class BinaryTest(fixtures.TestBase, AssertsExecutionResults): __excluded_on__ = ( ('mysql', '<', (4, 1, 1)), # screwy varbinary types -- cgit v1.2.1