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

TMSS-2877: adapted failing test

parent 56dc5800
No related branches found
No related tags found
No related merge requests found
...@@ -580,9 +580,6 @@ class TestFlatStations(unittest.TestCase): ...@@ -580,9 +580,6 @@ class TestFlatStations(unittest.TestCase):
""" """
def create_UC1_observation_scheduling_unit(self, name, scheduling_set): def create_UC1_observation_scheduling_unit(self, name, scheduling_set):
constraints_template = models.SchedulingConstraintsTemplate.get_latest(name="constraints")
constraints = add_defaults_to_json_object_for_schema({}, constraints_template.schema)
uc1_strategy_template = models.SchedulingUnitObservingStrategyTemplate.get_latest(name="IM HBA LoTSS - 2 Beams") uc1_strategy_template = models.SchedulingUnitObservingStrategyTemplate.get_latest(name="IM HBA LoTSS - 2 Beams")
scheduling_unit_spec = add_defaults_to_json_object_for_schema(uc1_strategy_template.template, scheduling_unit_spec = add_defaults_to_json_object_for_schema(uc1_strategy_template.template,
uc1_strategy_template.scheduling_unit_template.schema) uc1_strategy_template.scheduling_unit_template.schema)
...@@ -591,6 +588,11 @@ class TestFlatStations(unittest.TestCase): ...@@ -591,6 +588,11 @@ class TestFlatStations(unittest.TestCase):
scheduling_unit_spec['tasks']['Target Observation']['specifications_doc']['duration'] = 2 * 3600 scheduling_unit_spec['tasks']['Target Observation']['specifications_doc']['duration'] = 2 * 3600
scheduling_unit_spec['tasks']['Calibrator Observation 2']['specifications_doc']['duration'] = 2 * 60 scheduling_unit_spec['tasks']['Calibrator Observation 2']['specifications_doc']['duration'] = 2 * 60
constraints_template = models.SchedulingConstraintsTemplate.get_version_or_latest(name=scheduling_unit_spec.get('scheduling_constraints_template',{}).get('name', 'constraints'),
version=scheduling_unit_spec.get('scheduling_constraints_template', {}).get('version'))
constraints = constraints_template.get_default_json_document_for_schema()
# add the scheduling_unit_doc to a new SchedulingUnitDraft instance, and were ready to use it! # add the scheduling_unit_doc to a new SchedulingUnitDraft instance, and were ready to use it!
draft = models.SchedulingUnitDraft.objects.create(name=name, draft = models.SchedulingUnitDraft.objects.create(name=name,
scheduling_set=scheduling_set, scheduling_set=scheduling_set,
...@@ -1167,9 +1169,6 @@ class SchedulingUnitBlueprintIndirectModificationsTestCase(unittest.TestCase): ...@@ -1167,9 +1169,6 @@ class SchedulingUnitBlueprintIndirectModificationsTestCase(unittest.TestCase):
project = models.Project.objects.create(**Project_test_data(name='test', auto_ingest=True)) project = models.Project.objects.create(**Project_test_data(name='test', auto_ingest=True))
scheduling_set = models.SchedulingSet.objects.create(**SchedulingSet_test_data(project=project)) scheduling_set = models.SchedulingSet.objects.create(**SchedulingSet_test_data(project=project))
constraints_template = models.SchedulingConstraintsTemplate.get_latest(name="constraints")
constraints = add_defaults_to_json_object_for_schema({}, constraints_template.schema)
uc1_strategy_template = models.SchedulingUnitObservingStrategyTemplate.get_latest(name="IM HBA LoTSS - 2 Beams") uc1_strategy_template = models.SchedulingUnitObservingStrategyTemplate.get_latest(name="IM HBA LoTSS - 2 Beams")
scheduling_unit_spec = add_defaults_to_json_object_for_schema(uc1_strategy_template.template, uc1_strategy_template.scheduling_unit_template.schema) scheduling_unit_spec = add_defaults_to_json_object_for_schema(uc1_strategy_template.template, uc1_strategy_template.scheduling_unit_template.schema)
# limit target obs duration for demo data # limit target obs duration for demo data
...@@ -1177,6 +1176,10 @@ class SchedulingUnitBlueprintIndirectModificationsTestCase(unittest.TestCase): ...@@ -1177,6 +1176,10 @@ class SchedulingUnitBlueprintIndirectModificationsTestCase(unittest.TestCase):
scheduling_unit_spec['tasks']['Target Observation']['specifications_doc']['duration'] = 2 * 3600 scheduling_unit_spec['tasks']['Target Observation']['specifications_doc']['duration'] = 2 * 3600
scheduling_unit_spec['tasks']['Calibrator Observation 2']['specifications_doc']['duration'] = 2 * 60 scheduling_unit_spec['tasks']['Calibrator Observation 2']['specifications_doc']['duration'] = 2 * 60
constraints_template = models.SchedulingConstraintsTemplate.get_version_or_latest(name=scheduling_unit_spec.get('scheduling_constraints_template',{}).get('name', 'constraints'),
version=scheduling_unit_spec.get('scheduling_constraints_template', {}).get('version'))
constraints = constraints_template.get_default_json_document_for_schema()
# add the scheduling_unit_doc to a new SchedulingUnitDraft instance, and were ready to use it! # add the scheduling_unit_doc to a new SchedulingUnitDraft instance, and were ready to use it!
su_draft = models.SchedulingUnitDraft.objects.create(name="test", su_draft = models.SchedulingUnitDraft.objects.create(name="test",
scheduling_set=scheduling_set, scheduling_set=scheduling_set,
......
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