#NEWLINE# def test_timed_cycle( self ) : #NEWLINE# #INDENT# return #NEWLINE# target = 'http://requestbin.zapier.com/api/v1/bin/test_timed_cycle' #NEWLINE# hooks = [ self . make_hook ( event , target ) for event in [ 'comment.added' , 'comment.changed' , 'comment.removed' ] ] #NEWLINE# for n in range ( 4 ) : #NEWLINE# #INDENT# early = datetime . now ( ) #NEWLINE# for x in range ( 10 ) : #NEWLINE# #INDENT# comment = Comment . objects . create ( site = self . site , content_object = self . user , user = self . user , comment = 'Hello world!' ) #NEWLINE# comment . comment = 'Goodbye world...' #NEWLINE# comment . save ( ) #NEWLINE# comment . delete ( ) #NEWLINE# #UNINDENT# total = ( datetime . now ( ) - early ) #NEWLINE# print ( total ) #NEWLINE# while True : #NEWLINE# #INDENT# response = requests . get ( ( target + '/view' ) ) #NEWLINE# sent = response . json #NEWLINE# if self : #NEWLINE# #INDENT# print ( len ( sent ) , models . async_requests . total_sent ) #NEWLINE# #UNINDENT# if ( models . async_requests . total_sent >= ( 30 * ( n + 1 ) ) ) : #NEWLINE# #INDENT# time . sleep ( 5 ) #NEWLINE# break #NEWLINE# #UNINDENT# time . sleep ( 1 ) #NEWLINE# #UNINDENT# #UNINDENT# requests . delete ( ( target + '/view' ) )