#NEWLINE# def test_inheritance( self ) : #NEWLINE# #INDENT# ( users , addresses , User ) = ( am . tables . users , self . tables . addresses , self . classes . User ) #NEWLINE# ( Ext , methods ) = self . extension ( ) #NEWLINE# class AdminUser ( User ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# mapper ( User , users , extension = Ext ( ) ) #NEWLINE# mapper ( AdminUser , addresses , inherits = User , properties = { #NEWLINE# #INDENT# 'address_id' : addresses . c . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# sess = create_session ( ) #NEWLINE# am = AdminUser ( name = 'au1' , email_address = 'au1@e1' ) #NEWLINE# sess . add ( am ) #NEWLINE# sess . flush ( ) #NEWLINE# am = sess . query ( AdminUser ) . populate_existing ( ) . get ( am . id ) #NEWLINE# sess . expunge_all ( ) #NEWLINE# am = sess . query ( AdminUser ) . get ( am . id ) #NEWLINE# am . name = 'au1 changed' #NEWLINE# sess . flush ( ) #NEWLINE# sess . delete ( am ) #NEWLINE# sess . flush ( ) #NEWLINE# eq_ ( methods , [ 'instrument_class' , 'instrument_class' , 'init_instance' , 'before_insert' , 'after_insert' , 'reconstruct_instance' , 'before_update' , 'after_update' , 'before_delete' , 'after_delete' ] )