#NEWLINE# def test_basic( self ) : #NEWLINE# #INDENT# ( User , users ) = ( self . classes . User , self . tables . users ) #NEWLINE# mapper ( User , users ) #NEWLINE# canary = self . listen_all ( User ) #NEWLINE# named_canary = self . listen_all ( named_canary , named = True ) #NEWLINE# sess = create_session ( ) #NEWLINE# u = User ( name = 'u1' ) #NEWLINE# sess . add ( u ) #NEWLINE# sess . flush ( ) #NEWLINE# sess . expire ( u ) #NEWLINE# u = sess . query ( User ) . get ( u . id ) #NEWLINE# sess . expunge_all ( ) #NEWLINE# u = sess . query ( User ) . get ( u . id ) #NEWLINE# u . name = 'u1 changed' #NEWLINE# sess . flush ( ) #NEWLINE# sess . delete ( u ) #NEWLINE# sess . flush ( ) #NEWLINE# expected = [ 'init' , 'before_insert' , 'refresh_flush' , 'after_insert' , 'expire' , 'refresh' , 'load' , 'before_update' , 'refresh_flush' , 'after_update' , 'before_delete' , 'after_delete' ] #NEWLINE# eq_ ( canary , expected ) #NEWLINE# eq_ ( named_canary , expected )