]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
test multi-level eager load without the limiting subquery
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 8 Apr 2009 04:14:16 +0000 (04:14 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 8 Apr 2009 04:14:16 +0000 (04:14 +0000)
test/orm/eager_relations.py

index 1876eca25814195c8d628a40f467f322b9b160ab..87c2442cc42bbb778a9418a37f94e2c6fac7f959 100644 (file)
@@ -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()