]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- fix this test which did not allow for the A/ ASub to be loaded
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 13 Aug 2016 02:58:34 +0000 (22:58 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 13 Aug 2016 02:58:34 +0000 (22:58 -0400)
polymorphically

Change-Id: Id82435fa16b0456f32bce49715c6606e3a1534c8

test/orm/inheritance/test_relationship.py

index 0bbb138b04b87fdd1fa73b5cd172d607361fca53..46b934d7b0ce1478d73afe7288b52cc266175fe8 100644 (file)
@@ -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)