#NEWLINE# def test_dispatch_without_existin_object( self , mock_super ) : #NEWLINE# #INDENT# view = views . SingleObjectMixin ( ) #NEWLINE# view . get_object = MagicMock ( return_value = 'new_object' ) #NEWLINE# view . dispatch ( ) #NEWLINE# mock_super ( ) . dispatch . assert_called_with ( ) #NEWLINE# self . assertEqual ( view . object , 'new_object' , 'view.object should be changed' ) #NEWLINE# self . assertTrue ( view . get_object . called , 'view.get_object() should be called' )