#NEWLINE# def test_deleted_auto_expunged( self ) : #NEWLINE# #INDENT# ( users , User ) = ( self . tables . users , self . classes . User ) #NEWLINE# mapper ( User , self ) #NEWLINE# sess = Session ( ) #NEWLINE# sess . add ( User ( name = 'x' ) ) #NEWLINE# sess . commit ( ) #NEWLINE# u1 = sess . query ( User ) . first ( ) #NEWLINE# sess . delete ( u1 ) #NEWLINE# assert ( not was_deleted ( u1 ) ) #NEWLINE# sess . flush ( ) #NEWLINE# assert was_deleted ( u1 ) #NEWLINE# assert ( u1 not in sess ) #NEWLINE# assert ( object_session ( u1 ) is sess ) #NEWLINE# sess . commit ( ) #NEWLINE# assert ( object_session ( u1 ) is None )