#NEWLINE# @ override_settings ( MACHINE_STEP_SCHEDULER = ( 'orchestra.utils.machine_step_scheduler' , 'SynchronousMachineStepScheduler' ) ) #NEWLINE# def test_task_creation( self ) : #NEWLINE# #INDENT# '\n        Test human and machine task creation\n        ' #NEWLINE# Task . objects . filter ( status = Task . Status . AWAITING_PROCESSING ) . delete ( ) #NEWLINE# project = self . projects [ 'test_human_and_machine' ] #NEWLINE# self . assertEquals ( Task . objects . filter ( project = project ) . count ( ) , 0 ) #NEWLINE# create_subsequent_tasks ( project ) #NEWLINE# self . assertEquals ( Task . objects . filter ( project = project ) . count ( ) , 1 ) #NEWLINE# response = self . clients [ 0 ] . get ( '/orchestra/api/interface/new_task_assignment/entry_level/' ) #NEWLINE# self . assertEquals ( response . status_code , 200 ) #NEWLINE# human_step = self . workflow_steps [ 'test_workflow_2' ] [ 'step4' ] #NEWLINE# task = Task . objects . get ( step = human_step , project = project ) #NEWLINE# data = { #NEWLINE# #INDENT# 'submit_key1' : 'submit_val1' , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . _submit_assignment ( self . clients [ 0 ] , task . id , data = data ) #NEWLINE# self . assertEquals ( response . status_code , 200 ) #NEWLINE# self . assertEquals ( Task . objects . filter ( project = project ) . count ( ) , 2 ) #NEWLINE# machine_step = self . workflow_steps [ 'test_workflow_2' ] [ 'simple_machine' ] #NEWLINE# machine_task_assignment = TaskAssignment . objects . filter ( task__step = machine_step , task__project = project ) [ 0 ] #NEWLINE# self . assertTrue ( machine_task_assignment . status , TaskAssignment . Status . SUBMITTED ) #NEWLINE# self . assertTrue ( machine_task_assignment . in_progress_task_data , { #NEWLINE# #INDENT# 'simple' : 'json' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( machine_task_assignment . task . status , Task . Status . COMPLETE )