Skip to content
Snippets Groups Projects
Commit c690d025 authored by goei's avatar goei
Browse files

TMSS-207: Hack creating pipeline task blueprint when creating task blueprint observation

parent 6f4fc56c
Branches
No related tags found
1 merge request!162Intermediate merge of TMSS-207 to master
......@@ -25,9 +25,12 @@ def create_task_blueprint_from_task_draft_and_instantiate_subtasks_from_template
"""
logger.debug("create_task_blueprint_from_task_draft_and_instantiate_subtasks_from_template(task_draft.id=%s)...", task_draft.pk)
task_blueprint = create_task_blueprint_from_task_draft(task_draft)
obs_subtask = create_subtask_observation_control(task_blueprint)
pipe_subtask = create_subtask_pipeline_control(task_blueprint)
# HACK: I also create a task blueprint from task draft (pipeline) but that should not be done here....
task_blueprint_pipeline = create_task_blueprint_from_task_draft(TaskDraft.objects.get(name='Test PreProcessingPipeline Task'))
pipe_subtask = create_subtask_pipeline_control(task_blueprint_pipeline)
connect_observation_subtask_to_preprocessing_subtask(obs_subtask, pipe_subtask)
if task_blueprint.specifications_doc.get("QA",{}).get("file_conversion",{}).get("enabled", False):
......
......@@ -54,7 +54,7 @@ class SpecifyObservationFromTaskDraftTest(unittest.TestCase):
task_blueprint = create_task_blueprint_from_task_draft_and_instantiate_subtasks_from_template(task_draft)
self.assertEqual(task_draft.name, task_blueprint.draft.name)
res_task_blueprint = GET_and_assert_equal_expected_code(self, BASE_URL + '/task_blueprint/1/', 200)
self.assertEqual(len(res_task_blueprint['subtasks']), 4)
self.assertEqual(len(res_task_blueprint['subtasks']), 3)
self.assertEqual(res_task_blueprint['specifications_template'], res_task_draft['specifications_template'])
for subtask_url in res_task_blueprint['subtasks']:
res_subtask = GET_and_assert_equal_expected_code(self, subtask_url, 200)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment