diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-08-15 00:19:57 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-08-15 00:19:57 -0400 |
commit | b0411e80df13d347104a60c512aeb18b6479bb12 (patch) | |
tree | ed89d223058450a78b89c2733cc4f2112c1f9e3c | |
parent | b952d892d690ec808829aede84769b2bf089f94d (diff) | |
download | sqlalchemy-b0411e80df13d347104a60c512aeb18b6479bb12.tar.gz |
- other test fixes
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 2 | ||||
-rw-r--r-- | test/orm/test_naturalpks.py | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 65753b6dc..3728b59fd 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -799,7 +799,7 @@ class Connection(Connectable): if distilled_params: # note this is usually dict but we support RowProxy # as well; but dict.keys() as an iterator is OK - keys = distilled_params[0].keys() + keys = list(distilled_params[0].keys()) else: keys = [] diff --git a/test/orm/test_naturalpks.py b/test/orm/test_naturalpks.py index 53b661a49..a4e982f84 100644 --- a/test/orm/test_naturalpks.py +++ b/test/orm/test_naturalpks.py @@ -184,7 +184,7 @@ class NaturalPKTest(fixtures.MappedTest): if not passive_updates: # test passive_updates=False; #load addresses, update user, update 2 addresses - self.assert_sql_count(testing.db, go, 4) + self.assert_sql_count(testing.db, go, 3) else: # test passive_updates=True; update user self.assert_sql_count(testing.db, go, 1) @@ -239,7 +239,7 @@ class NaturalPKTest(fixtures.MappedTest): def go(): sess.flush() - self.assert_sql_count(testing.db, go, 3) + self.assert_sql_count(testing.db, go, 2) def _test_manytoone(self, passive_updates): users, Address, addresses, User = (self.tables.users, @@ -270,7 +270,7 @@ class NaturalPKTest(fixtures.MappedTest): if passive_updates: self.assert_sql_count(testing.db, go, 1) else: - self.assert_sql_count(testing.db, go, 3) + self.assert_sql_count(testing.db, go, 2) def go(): sess.flush() @@ -366,7 +366,8 @@ class NaturalPKTest(fixtures.MappedTest): if passive_updates: self.assert_sql_count(testing.db, go, 1) else: - self.assert_sql_count(testing.db, go, 3) + # two updates bundled + self.assert_sql_count(testing.db, go, 2) eq_([Address(username='ed'), Address(username='ed')], [ad1, ad2]) sess.expunge_all() eq_( @@ -383,7 +384,8 @@ class NaturalPKTest(fixtures.MappedTest): if passive_updates: self.assert_sql_count(testing.db, go, 1) else: - self.assert_sql_count(testing.db, go, 3) + # two updates bundled + self.assert_sql_count(testing.db, go, 2) sess.expunge_all() eq_( [Address(username='fred'), Address(username='fred')], @@ -789,8 +791,8 @@ class NonPKCascadeTest(fixtures.MappedTest): sess.flush() if not passive_updates: # test passive_updates=False; load addresses, - # update user, update 2 addresses - self.assert_sql_count(testing.db, go, 4) + # update user, update 2 addresses (in one executemany) + self.assert_sql_count(testing.db, go, 3) else: # test passive_updates=True; update user self.assert_sql_count(testing.db, go, 1) |