#NEWLINE# def test_make_transient_to_detached_no_session_allowed( 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# assert_raises_message ( sa . exc . InvalidRequestError , 'Given object must be transient' , make_transient_to_detached , u1 )