From: Mike Bayer Date: Wed, 8 Apr 2009 04:14:16 +0000 (+0000) Subject: test multi-level eager load without the limiting subquery X-Git-Tag: rel_0_5_4~30 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d9389fcafbdd9300070b37c4fe71e1d03707f9d;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git test multi-level eager load without the limiting subquery --- diff --git a/test/orm/eager_relations.py b/test/orm/eager_relations.py index 1876eca258..87c2442cc4 100644 --- a/test/orm/eager_relations.py +++ b/test/orm/eager_relations.py @@ -892,6 +892,20 @@ class SelfReferentialEagerTest(_base.MappedTest): n1.children[1].append(Node(data='n123')) sess.add(n1) sess.flush() + sess.expunge_all() + def go(): + d = sess.query(Node).filter_by(data='n1').all()[0] + assert Node(data='n1', children=[ + Node(data='n11'), + Node(data='n12', children=[ + Node(data='n121'), + Node(data='n122'), + Node(data='n123') + ]), + Node(data='n13') + ]) == d + self.assert_sql_count(testing.db, go, 1) + sess.expunge_all() def go(): d = sess.query(Node).filter_by(data='n1').first()