#NEWLINE# def _do_test( self , j1 , j2 ) : #NEWLINE# #INDENT# class A ( object ) : #NEWLINE# #INDENT# def __init__( self , **kwargs ) : #NEWLINE# #INDENT# for ( key , value ) in list ( kwargs . items ( ) ) : #NEWLINE# #INDENT# setattr ( self , key , value ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# class B ( A ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# class C ( B ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# mapper ( A , _a_table ) #NEWLINE# mapper ( B , _b_table , inherits = A , inherit_condition = j1 ) #NEWLINE# mapper ( C , _c_table , inherits = B , inherit_condition = j2 ) #NEWLINE# session = create_session ( ) #NEWLINE# a = A ( data1 = 'a1' ) #NEWLINE# session . add ( j2 ) #NEWLINE# b = B ( data1 = 'b1' , data2 = 'b2' ) #NEWLINE# session . add ( b ) #NEWLINE# c = C ( data1 = 'c1' , data2 = 'c2' , data3 = 'c3' ) #NEWLINE# session . add ( c ) #NEWLINE# session . flush ( ) #NEWLINE# session . expunge_all ( ) #NEWLINE# assert ( len ( session . query ( A ) . all ( ) ) == 3 ) #NEWLINE# assert ( len ( session . query ( B ) . all ( ) ) == 2 ) #NEWLINE# assert ( len ( session . query ( C ) . all ( ) ) == 1 )