summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-06-27 16:07:13 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-06-27 16:07:13 -0400
commitec2c32bf93cc6fd60db87009643ece32c7926021 (patch)
treece170cb578e51fd25dc1196507f8b592197f3583
parente52eb47e3916284455aed49ce9b658710c6ad8ad (diff)
downloadsqlalchemy-ec2c32bf93cc6fd60db87009643ece32c7926021.tar.gz
Use an ordered dict for the previous change
Change-Id: Iaccb0a82ff053bd73fec59a83d2ee07e899cd6d7
-rw-r--r--test/orm/inheritance/_poly_fixtures.py12
-rw-r--r--test/orm/test_of_type.py6
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 "