From: Mike Bayer Date: Sat, 13 Aug 2016 02:58:34 +0000 (-0400) Subject: - fix this test which did not allow for the A/ ASub to be loaded X-Git-Tag: rel_1_1_0~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bec5d6991e4eacdba3529ea71d30bb7fd614fdc9;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - fix this test which did not allow for the A/ ASub to be loaded polymorphically Change-Id: Id82435fa16b0456f32bce49715c6606e3a1534c8 --- diff --git a/test/orm/inheritance/test_relationship.py b/test/orm/inheritance/test_relationship.py index 0bbb138b04..46b934d7b0 100644 --- a/test/orm/inheritance/test_relationship.py +++ b/test/orm/inheritance/test_relationship.py @@ -1871,7 +1871,8 @@ class SameNameOnJoined(fixtures.MappedTest): 'a', metadata, Column( 'id', Integer, primary_key=True, - test_needs_autoincrement=True) + test_needs_autoincrement=True), + Column('t', String(5)) ) Table( 'a_sub', metadata, @@ -1896,13 +1897,20 @@ class SameNameOnJoined(fixtures.MappedTest): class B(cls.Comparable): pass - mapper(A, cls.tables.a, properties={ - 'bs': relationship(B, cascade="all, delete-orphan") - }) + mapper( + A, cls.tables.a, polymorphic_on=cls.tables.a.c.t, + polymorphic_identity='a', + properties={ + 'bs': relationship(B, cascade="all, delete-orphan") + } + ) - mapper(ASub, cls.tables.a_sub, inherits=A, properties={ - 'bs': relationship(B, cascade="all, delete-orphan") - }) + mapper( + ASub, cls.tables.a_sub, inherits=A, + polymorphic_identity='asub', properties={ + 'bs': relationship(B, cascade="all, delete-orphan") + } + ) mapper(B, cls.tables.b)