#NEWLINE# def test_dont_generate_on_none( self ) : #NEWLINE# #INDENT# ( base , sub ) = ( self . tables . base , self . tables . sub ) #NEWLINE# class Base ( fixtures . BasicEntity ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# class Sub ( Base ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# mapper ( Base , base , polymorphic_on = base . c . type , polymorphic_identity = 'base' ) #NEWLINE# m = mapper ( Sub , s1 , inherits = Base , polymorphic_identity = 'sub' ) #NEWLINE# s1 = Sub ( ) #NEWLINE# assert ( m . _optimized_get_statement ( attributes . instance_state ( s1 ) , [ 'subcounter2' ] ) is None ) #NEWLINE# eq_ ( s1 . id , None ) #NEWLINE# assert ( m . _optimized_get_statement ( attributes . instance_state ( s1 ) , [ 'subcounter2' ] ) is None ) #NEWLINE# s1 . id = 1 #NEWLINE# attributes . instance_state ( s1 ) . _commit_all ( s1 . __dict__ , None ) #NEWLINE# assert ( m . _optimized_get_statement ( attributes . instance_state ( s1 ) , [ 'subcounter2' ] ) is not None )