Skip to content
Snippets Groups Projects
Commit 7210bec8 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-917: adapted and fixed various tests now that we reverted to a single...

TMSS-917: adapted and fixed various tests now that we reverted to a single parent TaskBlueprint for a Subtask.
parent c479d556
No related branches found
No related tags found
2 merge requests!634WIP: COBALT commissioning delta,!540TMSS-917: primary subtask
...@@ -68,11 +68,11 @@ class SubtaskValidationTest(unittest.TestCase): ...@@ -68,11 +68,11 @@ class SubtaskValidationTest(unittest.TestCase):
subtask_template = self.create_subtask_template(minimal_json_schema()) subtask_template = self.create_subtask_template(minimal_json_schema())
specifications_doc = '{ this is not a json object }' specifications_doc = '{ this is not a json object }'
subtask_data = Subtask_test_data(subtask_template=subtask_template, specifications_doc=specifications_doc, subtask_data = Subtask_test_data(subtask_template=subtask_template, specifications_doc=specifications_doc,
cluster=self.cluster, state=self.state) cluster=self.cluster, state=self.state,
task_blueprint=self.task_blueprint)
with self.assertRaises(SchemaValidationException) as context: with self.assertRaises(SchemaValidationException) as context:
subtask = models.Subtask.objects.create(**subtask_data) subtask = models.Subtask.objects.create(**subtask_data)
subtask.task_blueprints.set([self.task_blueprint])
self.assertTrue('invalid json' in str(context.exception).lower()) self.assertTrue('invalid json' in str(context.exception).lower())
def test_validate_correlator_schema_with_valid_specification(self): def test_validate_correlator_schema_with_valid_specification(self):
......
...@@ -50,9 +50,8 @@ def create_subtask_object_for_testing(subtask_type_value): ...@@ -50,9 +50,8 @@ def create_subtask_object_for_testing(subtask_type_value):
""" """
template_type = models.SubtaskType.objects.get(value=subtask_type_value) template_type = models.SubtaskType.objects.get(value=subtask_type_value)
subtask_template_obj = create_subtask_template_for_testing(template_type) subtask_template_obj = create_subtask_template_for_testing(template_type)
subtask_data = Subtask_test_data(subtask_template=subtask_template_obj) subtask_data = Subtask_test_data(subtask_template=subtask_template_obj, task_blueprint=models.TaskBlueprint.objects.create(**TaskBlueprint_test_data()))
subtask = models.Subtask.objects.create(**subtask_data) subtask = models.Subtask.objects.create(**subtask_data)
subtask.task_blueprints.set([models.TaskBlueprint.objects.create(**TaskBlueprint_test_data())])
return subtask return subtask
def create_subtask_template_for_testing(template_type: object): def create_subtask_template_for_testing(template_type: object):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment