#NEWLINE# def test_entry_level_task_assignment( self ) : #NEWLINE# #INDENT# response = self . clients [ 2 ] . get ( '/orchestra/api/interface/new_task_assignment/entry_level/' ) #NEWLINE# self . assertEquals ( response . status_code , 400 ) #NEWLINE# returned = json . loads ( response . content . decode ( 'utf-8' ) ) #NEWLINE# self . assertEquals ( returned [ 'message' ] , 'No worker certificates' ) #NEWLINE# response = self . clients [ 0 ] . get ( '/orchestra/api/interface/new_task_assignment/entry_level/' ) #NEWLINE# self . assertEquals ( response . status_code , 200 ) #NEWLINE# returned = json . loads ( response . content . decode ( 'utf-8' ) ) #NEWLINE# task = Task . objects . get ( id = returned [ 'id' ] ) #NEWLINE# self . assertEquals ( { #NEWLINE# #INDENT# 'id' : task . id , #NEWLINE# 'assignment_id' : task . assignments . get ( worker = self . workers [ 0 ] ) . id , #NEWLINE# 'step' : task . step . slug , #NEWLINE# 'project' : task . project . workflow_version . slug , #NEWLINE# 'detail' : task . project . short_description , #NEWLINE# #UNINDENT# } , returned ) #NEWLINE# self . _verify_bad_task_assignment_information ( self . clients [ 0 ] , { #NEWLINE# #INDENT# 'task_id' : ( - 1 ) , #NEWLINE# #UNINDENT# } , 'Task matching query does not exist.' ) #NEWLINE# self . _verify_bad_task_assignment_information ( self . clients [ 2 ] , { #NEWLINE# #INDENT# 'task_id' : task . id , #NEWLINE# #UNINDENT# } , 'Worker is not associated with task' ) #NEWLINE# self . _verify_good_task_assignment_information ( self . clients [ 0 ] , { #NEWLINE# #INDENT# 'task_id' : task . id , #NEWLINE# #UNINDENT# } , task . project . short_description , 'Processing' , 'Processing' , False , False , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , self . workers [ 0 ] ) #NEWLINE# response = self . clients [ 0 ] . get ( '/orchestra/api/interface/new_task_assignment/entry_level/' ) #NEWLINE# self . assertEquals ( response . status_code , 400 ) #NEWLINE# returned = json . loads ( response . content . decode ( 'utf-8' ) ) #NEWLINE# self . assertEquals ( returned [ 'message' ] , 'No task' )