#NEWLINE# def test_lazy_fallback_doesnt_affect_eager( self ) : #NEWLINE# #INDENT# nodes = n1 . tables . nodes #NEWLINE# class Node ( fixtures . ComparableEntity ) : #NEWLINE# #INDENT# def append( self , node ) : #NEWLINE# #INDENT# self . children . append ( node ) #NEWLINE# #UNINDENT# #UNINDENT# mapper ( Node , nodes , properties = { #NEWLINE# #INDENT# 'children' : relationship ( Node , lazy = 'subquery' , join_depth = 1 , order_by = nodes . c . id ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# sess = create_session ( ) #NEWLINE# n1 = Node ( data = 'n1' ) #NEWLINE# n1 . append ( Node ( data = 'n11' ) ) #NEWLINE# n1 . append ( Node ( data = 'n12' ) ) #NEWLINE# n1 . append ( Node ( data = 'n13' ) ) #NEWLINE# n1 . children [ 1 ] . append ( Node ( data = 'n121' ) ) #NEWLINE# n1 . children [ 1 ] . append ( Node ( data = 'n122' ) ) #NEWLINE# n1 . children [ 1 ] . append ( Node ( data = 'n123' ) ) #NEWLINE# sess . add ( n1 ) #NEWLINE# sess . flush ( ) #NEWLINE# sess . expunge_all ( ) #NEWLINE# def go( ) : #NEWLINE# #INDENT# allnodes = sess . query ( Node ) . order_by ( Node . data ) . all ( ) #NEWLINE# n12 = allnodes [ 2 ] #NEWLINE# eq_ ( n12 . data , 'n12' ) #NEWLINE# eq_ ( [ Node ( data = 'n121' ) , Node ( data = 'n122' ) , Node ( data = 'n123' ) ] , list ( n12 . children ) ) #NEWLINE# #UNINDENT# self . assert_sql_count ( testing . db , go , 4 )