From: Mike Bayer Date: Fri, 30 Aug 2019 17:11:05 +0000 (-0400) Subject: Don't create enum constraints in enum sortable tests X-Git-Tag: rel_1_3_9~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2839c22d93d28a10b88b3e646494866eacc8250;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Don't create enum constraints in enum sortable tests Fixed unit test regression released in 1.3.8 that would cause failure for Oracle, SQL Server and other non-native ENUM platforms due to new enumeration tests added as part of :ticket:`4285` enum sortability in the unit of work; the enumerations created constraints that were duplicated on name. Fixes: #4285 Change-Id: I34f51e82be9b6bb43b0df8c54bb36822e6eeb73e (cherry picked from commit 2df613243de33aaa202b3ac458304b8ab403e9e7) --- diff --git a/doc/build/changelog/unreleased_13/4285.rst b/doc/build/changelog/unreleased_13/4285.rst new file mode 100644 index 0000000000..082d3e95e4 --- /dev/null +++ b/doc/build/changelog/unreleased_13/4285.rst @@ -0,0 +1,9 @@ +.. change:: + :tags: bug, tests + :tickets: 4285 + + Fixed unit test regression released in 1.3.8 that would cause failure for + Oracle, SQL Server and other non-native ENUM platforms due to new + enumeration tests added as part of :ticket:`4285` enum sortability in the + unit of work; the enumerations created constraints that were duplicated on + name. diff --git a/test/orm/test_unitofwork.py b/test/orm/test_unitofwork.py index 6185c4a51c..f5cc4836f2 100644 --- a/test/orm/test_unitofwork.py +++ b/test/orm/test_unitofwork.py @@ -3407,7 +3407,11 @@ class EnsurePKSortableTest(fixtures.MappedTest): Table( "t1", metadata, - Column("id", Enum(cls.MySortableEnum), primary_key=True), + Column( + "id", + Enum(cls.MySortableEnum, create_constraint=False), + primary_key=True, + ), Column("data", String(10)), ) @@ -3416,7 +3420,11 @@ class EnsurePKSortableTest(fixtures.MappedTest): metadata, Column( "id", - Enum(cls.MyNotSortableEnum, sort_key_function=None), + Enum( + cls.MyNotSortableEnum, + sort_key_function=None, + create_constraint=False, + ), primary_key=True, ), Column("data", String(10)), @@ -3425,7 +3433,11 @@ class EnsurePKSortableTest(fixtures.MappedTest): Table( "t3", metadata, - Column("id", Enum(cls.MyNotSortableEnum), primary_key=True), + Column( + "id", + Enum(cls.MyNotSortableEnum, create_constraint=False), + primary_key=True, + ), Column("value", Integer), )