#NEWLINE# def test_loads_second_level_collection_to_scalar( self ) : #NEWLINE# #INDENT# ( User , Address , Dingaling , sess ) = self . _collection_to_scalar_fixture ( ) #NEWLINE# u1 = sess . query ( User ) . get ( 8 ) #NEWLINE# a1 = Address ( ) #NEWLINE# u1 . addresses . append ( a1 ) #NEWLINE# a2 = u1 . addresses [ 0 ] #NEWLINE# a2 . email_address = 'foo' #NEWLINE# sess . query ( User ) . options ( subqueryload_all ( 'addresses.dingaling' ) ) . filter_by ( id = 8 ) . all ( ) #NEWLINE# assert ( u1 . addresses [ ( - 1 ) ] is a1 ) #NEWLINE# for a in u1 . addresses : #NEWLINE# #INDENT# if ( a is not a1 ) : #NEWLINE# #INDENT# assert ( 'dingaling' in a . __dict__ ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( 'dingaling' not in a . __dict__ ) #NEWLINE# #UNINDENT# if ( a is a2 ) : #NEWLINE# #INDENT# eq_ ( a2 . email_address , 'foo' )