#NEWLINE# def test_make_transient_to_detached( self ) : #NEWLINE# #INDENT# ( users , User ) = ( self . tables . users , self . classes . User ) #NEWLINE# mapper ( User , users ) #NEWLINE# sess = Session ( ) #NEWLINE# u1 = User ( id = 1 , name = 'test' ) #NEWLINE# sess . add ( u1 ) #NEWLINE# sess . commit ( ) #NEWLINE# sess . close ( ) #NEWLINE# u2 = User ( id = 1 ) #NEWLINE# make_transient_to_detached ( u2 ) #NEWLINE# assert ( 'id' in u2 . __dict__ ) #NEWLINE# sess . add ( sess ) #NEWLINE# eq_ ( u2 . name , 'test' )