summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-08-12 22:58:34 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2016-08-12 22:58:34 -0400
commitbec5d6991e4eacdba3529ea71d30bb7fd614fdc9 (patch)
tree9cb90f41f55a908132a6932236acb92057bcef03
parentc3ad6da0c4a441d8d76376af29df3a18faba4361 (diff)
downloadsqlalchemy-bec5d6991e4eacdba3529ea71d30bb7fd614fdc9.tar.gz
- fix this test which did not allow for the A/ ASub to be loaded
polymorphically Change-Id: Id82435fa16b0456f32bce49715c6606e3a1534c8
-rw-r--r--test/orm/inheritance/test_relationship.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/orm/inheritance/test_relationship.py b/test/orm/inheritance/test_relationship.py
index 0bbb138b0..46b934d7b 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)