#NEWLINE# @ patch ( 'requests.post' ) #NEWLINE# def test_raw_custom_event( self , method_mock ) : #NEWLINE# #INDENT# from rest_hooks.signals import raw_hook_event #NEWLINE# method_mock . return_value = None #NEWLINE# target = 'http://example.com/test_raw_custom_event' #NEWLINE# hook = self . make_hook ( 'special.thing' , target ) #NEWLINE# raw_hook_event . send ( sender = None , event_name = 'special.thing' , payload = { #NEWLINE# #INDENT# 'hello' : 'world!' , #NEWLINE# #UNINDENT# } , user = self . user ) #NEWLINE# payload = json . loads ( method_mock . mock_calls [ 0 ] [ 2 ] [ 'data' ] ) #NEWLINE# self . assertEquals ( 'special.thing' , self [ 'hook' ] [ 'event' ] ) #NEWLINE# self . assertEquals ( 'world!' , payload [ 'data' ] [ 'hello' ] )