#NEWLINE# def test_use_get( self ) : #NEWLINE# #INDENT# ( base , sub , related ) = ( self . tables . base , self . tables . sub , self . tables . related ) #NEWLINE# class Base ( fixtures . BasicEntity ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# class Sub ( Base ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# class Related ( Base ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# mapper ( Base , base , polymorphic_on = base . c . type , polymorphic_identity = 'b' ) #NEWLINE# mapper ( Sub , sub , inherits = Base , polymorphic_identity = 's' ) #NEWLINE# mapper ( Related , related , properties = { #NEWLINE# #INDENT# 'sub' : relationship ( Sub ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert class_mapper ( Related ) . get_property ( 'sub' ) . strategy . use_get #NEWLINE# sess = create_session ( ) #NEWLINE# s1 = Sub ( ) #NEWLINE# r1 = Related ( sub = s1 ) #NEWLINE# sess . add ( r1 ) #NEWLINE# sess . flush ( ) #NEWLINE# sess . expunge_all ( ) #NEWLINE# r1 = sess . query ( Related ) . first ( ) #NEWLINE# s1 = sess . query ( Sub ) . first ( ) #NEWLINE# def go( ) : #NEWLINE# #INDENT# assert r1 . sub #NEWLINE# #UNINDENT# self . assert_sql_count ( testing . db , go , 0 )