#NEWLINE# def test_basic( self ) : #NEWLINE# #INDENT# class Foo ( object ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# class Bar ( Foo ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# foos = mapper ( Foo , foo ) #NEWLINE# bars = mapper ( Bar , bar , inherits = foos ) #NEWLINE# bars . add_property ( 'lazy' , relationship ( foos , bar_foo , lazy = 'select' ) ) #NEWLINE# bars . add_property ( 'eager' , relationship ( foos , bar_foo , lazy = 'joined' ) ) #NEWLINE# foo . insert ( ) . execute ( data = 'foo1' ) #NEWLINE# bar . insert ( ) . execute ( id = 1 , data = 'bar1' ) #NEWLINE# foo . insert ( ) . execute ( data = 'foo2' ) #NEWLINE# bar . insert ( ) . execute ( id = 2 , data = 'bar2' ) #NEWLINE# foo . insert ( ) . execute ( data = 'foo3' ) #NEWLINE# foo . insert ( ) . execute ( data = 'foo4' ) #NEWLINE# bar_foo . insert ( ) . execute ( bar_id = 1 , foo_id = 3 ) #NEWLINE# bar_foo . insert ( ) . execute ( bar_id = 2 , foo_id = 4 ) #NEWLINE# sess = create_session ( ) #NEWLINE# q = sess . query ( Bar ) #NEWLINE# self . assert_ ( ( len ( q . first ( ) . lazy ) == 1 ) ) #NEWLINE# self . assert_ ( ( len ( q . first ( ) . eager ) == 1 ) )