#NEWLINE# def test_with_no_autoflush( self ) : #NEWLINE# #INDENT# ( User , users ) = ( self . classes . User , self . tables . users ) #NEWLINE# mapper ( User , users ) #NEWLINE# sess = Session ( ) #NEWLINE# u = User ( ) #NEWLINE# u . name = 'ed' #NEWLINE# sess . add ( u ) #NEWLINE# def go( obj ) : #NEWLINE# #INDENT# assert ( u not in sess . query ( User ) . all ( ) ) #NEWLINE# #UNINDENT# testing . run_as_contextmanager ( sess . no_autoflush , self ) #NEWLINE# assert ( u in sess . new ) #NEWLINE# assert ( u in sess . query ( User ) . all ( ) ) #NEWLINE# assert ( u not in sess . new )