#NEWLINE# def test_signal_emitted_upon_success( self ) : #NEWLINE# #INDENT# wrapper = ( lambda * args , **kwargs : None ) #NEWLINE# mock_handler = MagicMock ( wraps = wrapper ) #NEWLINE# signals . hook_sent_event . connect ( mock_handler , sender = Hook ) #NEWLINE# ( hook , comment , payload ) = self . perform_create_request_cycle ( ) #NEWLINE# payload [ 'data' ] [ 'fields' ] [ 'submit_date' ] = ANY #NEWLINE# mock_handler . assert_called_with ( signal = ANY , sender = Hook , payload = payload , instance = comment , hook = hook )