diff options
| -rw-r--r-- | test/orm/inheritance/_poly_fixtures.py | 12 | ||||
| -rw-r--r-- | test/orm/test_of_type.py | 6 |
2 files changed, 11 insertions, 7 deletions
diff --git a/test/orm/inheritance/_poly_fixtures.py b/test/orm/inheritance/_poly_fixtures.py index cc253a380..aa428a5eb 100644 --- a/test/orm/inheritance/_poly_fixtures.py +++ b/test/orm/inheritance/_poly_fixtures.py @@ -1,6 +1,7 @@ from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import String +from sqlalchemy import util from sqlalchemy.orm import create_session from sqlalchemy.orm import mapper from sqlalchemy.orm import polymorphic_union @@ -385,13 +386,16 @@ class _PolymorphicUnions(_PolymorphicFixtureBase): cls.tables.boss, ) person_join = polymorphic_union( - { - "engineer": people.join(engineers), - "manager": people.join(managers), - }, + util.OrderedDict( + [ + ("engineer", people.join(engineers)), + ("manager", people.join(managers)), + ] + ), None, "pjoin", ) + manager_join = people.join(managers).outerjoin(boss) person_with_polymorphic = ([Person, Manager, Engineer], person_join) manager_with_polymorphic = ("*", manager_join) diff --git a/test/orm/test_of_type.py b/test/orm/test_of_type.py index 375f70694..ce1c9548c 100644 --- a/test/orm/test_of_type.py +++ b/test/orm/test_of_type.py @@ -273,9 +273,9 @@ class PolymorphicPolymorphicTest( class PolymorphicUnionsTest(_PolymorphicTestBase, _PolymorphicUnions): def _polymorphic_join_target(self, cls): return ( - "(SELECT engineers.person_id AS person_id, " - "people.company_id AS company_id, people.name AS name, " - "people.type AS type, engineers.status AS status, " + "(SELECT engineers.person_id AS person_id, people.company_id " + "AS company_id, people.name AS name, people.type AS type, " + "engineers.status AS status, " "engineers.engineer_name AS engineer_name, " "engineers.primary_language AS primary_language, " "CAST(NULL AS VARCHAR(50)) AS manager_name FROM people " |
