From bec5d6991e4eacdba3529ea71d30bb7fd614fdc9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 12 Aug 2016 22:58:34 -0400 Subject: [PATCH] - fix this test which did not allow for the A/ ASub to be loaded polymorphically Change-Id: Id82435fa16b0456f32bce49715c6606e3a1534c8 --- test/orm/inheritance/test_relationship.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) 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) -- 2.47.2