summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/orm/strategy_options.py2
-rw-r--r--test/orm/test_deferred.py11
-rw-r--r--test/orm/test_options.py2
-rw-r--r--test/profiles.txt2
4 files changed, 9 insertions, 8 deletions
diff --git a/lib/sqlalchemy/orm/strategy_options.py b/lib/sqlalchemy/orm/strategy_options.py
index 0e2cf3a61..72dafb472 100644
--- a/lib/sqlalchemy/orm/strategy_options.py
+++ b/lib/sqlalchemy/orm/strategy_options.py
@@ -171,7 +171,7 @@ class Load(Generative, MapperOption):
def _coerce_strat(self, strategy):
if strategy is not None:
- strategy = tuple(strategy.items())
+ strategy = tuple(sorted(strategy.items()))
return strategy
@_generative
diff --git a/test/orm/test_deferred.py b/test/orm/test_deferred.py
index 3336f03b5..88e7e8663 100644
--- a/test/orm/test_deferred.py
+++ b/test/orm/test_deferred.py
@@ -5,7 +5,7 @@ from sqlalchemy.orm import mapper, deferred, defer, undefer, Load, \
joinedload, defaultload
from sqlalchemy.testing import eq_, AssertsCompiledSQL
from test.orm import _fixtures
-
+from sqlalchemy.orm import strategies
class DeferredTest(AssertsCompiledSQL, _fixtures.FixtureTest):
@@ -536,10 +536,11 @@ class DeferredOptionsTest(AssertsCompiledSQL, _fixtures.FixtureTest):
addresses = self.tables.addresses
orders = self.tables.orders
- mapper(User, users, properties={
- "addresses": relationship(Address, lazy="joined"),
- "orders": relationship(Order, lazy="joined")
- })
+ mapper(User, users, properties=util.OrderedDict([
+ ("addresses", relationship(Address, lazy="joined")),
+ ("orders", relationship(Order, lazy="joined"))
+ ]))
+
mapper(Address, addresses)
mapper(Order, orders)
diff --git a/test/orm/test_options.py b/test/orm/test_options.py
index 29c2c698e..6eba38d15 100644
--- a/test/orm/test_options.py
+++ b/test/orm/test_options.py
@@ -141,7 +141,7 @@ class LoadTest(PathTest, QueryTest):
l1 = Load(User)
l2 = l1.defer("name")
- l3 = l2.context.values()[0]
+ l3 = list(l2.context.values())[0]
eq_(
l1.context,
{
diff --git a/test/profiles.txt b/test/profiles.txt
index 9b6cf5aa5..c1ee8638a 100644
--- a/test/profiles.txt
+++ b/test/profiles.txt
@@ -399,7 +399,7 @@ test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_6_editing 3.3_postgresq
# TEST: test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview
-test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview 2.7_postgresql_psycopg2_cextensions 2300
+test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview 2.7_postgresql_psycopg2_cextensions 2424
test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview 2.7_postgresql_psycopg2_nocextensions 2559
test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview 3.2_postgresql_psycopg2_nocextensions 2483
test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview 3.3_postgresql_psycopg2_cextensions 2460