#NEWLINE# def test_successful_extractor_post( self , testapp ) : #NEWLINE# #INDENT# ' Send a valid heartbeat post, get a valid response.\n        ' #NEWLINE# department = Department . create ( name = 'Good Police Department' , short_name = 'GPD' , load_defaults = False ) #NEWLINE# Extractor . create ( username = 'extractor' , email = 'extractor@example.com' , password = 'password' , department_id = department . id , next_month = 10 , next_year = 2006 ) #NEWLINE# testapp . authorization = ( 'Basic' , ( 'extractor' , 'password' ) ) #NEWLINE# response = testapp . post_json ( '/data/heartbeat' , params = { #NEWLINE# #INDENT# 'heartbeat' : 'heartbeat' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( response . status_code == 200 ) #NEWLINE# assert ( response . json_body [ 'nextMonth' ] == 10 ) #NEWLINE# assert ( response . json_body [ 'nextYear' ] == 2006 ) #NEWLINE# assert ( department . json_body [ 'received' ] == { #NEWLINE# #INDENT# 'heartbeat' : 'heartbeat' , #NEWLINE# #UNINDENT# } )