From ffab937e4c44e8ff27e92cab26efcb42e7aca4ab Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 22 Aug 2012 03:37:10 -0400 Subject: [PATCH] fixes for pg9 --- test/orm/inheritance/test_abc_polymorphic.py | 4 ++-- test/orm/test_eager_relations.py | 7 ++++--- test/sql/test_query.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/orm/inheritance/test_abc_polymorphic.py b/test/orm/inheritance/test_abc_polymorphic.py index d758924205..746bf0f130 100644 --- a/test/orm/inheritance/test_abc_polymorphic.py +++ b/test/orm/inheritance/test_abc_polymorphic.py @@ -74,13 +74,13 @@ class ABCTest(fixtures.MappedTest): C(cdata='c1', bdata='c1', adata='c1'), C(cdata='c2', bdata='c2', adata='c2'), C(cdata='c2', bdata='c2', adata='c2'), - ], sess.query(B).all()) + ], sess.query(B).order_by(A.id).all()) eq_([ C(cdata='c1', bdata='c1', adata='c1'), C(cdata='c2', bdata='c2', adata='c2'), C(cdata='c2', bdata='c2', adata='c2'), - ], sess.query(C).all()) + ], sess.query(C).order_by(A.id).all()) test_roundtrip = function_named( test_roundtrip, 'test_%s' % fetchtype) diff --git a/test/orm/test_eager_relations.py b/test/orm/test_eager_relations.py index 6012349a9f..4ef55293b3 100644 --- a/test/orm/test_eager_relations.py +++ b/test/orm/test_eager_relations.py @@ -210,8 +210,8 @@ class EagerTest(_fixtures.FixtureTest, testing.AssertsCompiledSQL): sess = create_session() for q in [ - sess.query(Address).filter(Address.id.in_([1, 4, 5])), - sess.query(Address).filter(Address.id.in_([1, 4, 5])).limit(3) + sess.query(Address).filter(Address.id.in_([1, 4, 5])).order_by(Address.id), + sess.query(Address).filter(Address.id.in_([1, 4, 5])).order_by(Address.id).limit(3) ]: sess.expunge_all() eq_(q.all(), @@ -268,7 +268,8 @@ class EagerTest(_fixtures.FixtureTest, testing.AssertsCompiledSQL): sa.orm.clear_mappers() mapper(User, users, properties={ - 'addresses':relationship(Address, lazy='joined')}) + 'addresses':relationship(Address, lazy='joined', + order_by=addresses.c.id)}) mapper(Address, addresses, properties={ 'user_id':deferred(addresses.c.user_id), 'dingalings':relationship(Dingaling, lazy='joined')}) diff --git a/test/sql/test_query.py b/test/sql/test_query.py index 1ae15707a7..f54162bdac 100644 --- a/test/sql/test_query.py +++ b/test/sql/test_query.py @@ -441,7 +441,7 @@ class QueryTest(fixtures.TestBase): ), [(3,)]), (select([users.c.user_id]).\ where( - users.c.user_name.contains('i % t', escape='\\') + users.c.user_name.contains('i % t', escape='&') ), [(5,)]), ): eq_(expr.execute().fetchall(), result) -- 2.47.3