#NEWLINE# def test_simple( self ) : #NEWLINE# #INDENT# session = self . session ( ) #NEWLINE# query = session . query ( Person ) #NEWLINE# qs = ( yield query . load_only ( 'group' ) . all ( ) ) #NEWLINE# for m in qs : #NEWLINE# #INDENT# self . assertEqual ( m . _loadedfields , ( 'group' , ) ) #NEWLINE# self . assertFalse ( hasattr ( m , 'name' ) ) #NEWLINE# self . assertTrue ( hasattr ( m , 'group_id' ) ) #NEWLINE# self . assertTrue ( m . group_id ) #NEWLINE# self . assertTrue ( ( 'id' in self . _dbdata ) ) #NEWLINE# self . assertEqual ( m . _dbdata [ 'id' ] , m . id ) #NEWLINE# g = ( yield m . group ) #NEWLINE# self . assertTrue ( isinstance ( g , Group ) )