diff --git a/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py b/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py index 1b641d44adaca8060c9a407df54525d15ee8be5f..853e557fee83b99ee0474d32747485becc348e7b 100644 --- a/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py +++ b/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.12 on 2020-08-18 15:02 +# Generated by Django 2.2.12 on 2020-08-19 07:08 from django.conf import settings import django.contrib.postgres.fields @@ -986,7 +986,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='schedulingunitdraft', name='observation_strategy_template', - field=models.ForeignKey(help_text='Observation Strategy Template used to create the requirements_doc.', on_delete=django.db.models.deletion.CASCADE, to='tmssapp.SchedulingUnitObservingStrategyTemplate'), + field=models.ForeignKey(help_text='Observation Strategy Template used to create the requirements_doc.', null=True, on_delete=django.db.models.deletion.CASCADE, to='tmssapp.SchedulingUnitObservingStrategyTemplate'), ), migrations.AddField( model_name='schedulingunitdraft', diff --git a/SAS/TMSS/src/tmss/tmssapp/models/specification.py b/SAS/TMSS/src/tmss/tmssapp/models/specification.py index dc2cea04da03901454477a878753e99cf7aca558..e9400ff59d15bb90c00d18953cb93e4183e9e0cf 100644 --- a/SAS/TMSS/src/tmss/tmssapp/models/specification.py +++ b/SAS/TMSS/src/tmss/tmssapp/models/specification.py @@ -379,7 +379,7 @@ class SchedulingUnitDraft(NamedCommon): generator_instance_doc = JSONField(null=True, help_text='Parameter value that generated this run draft (NULLable).') scheduling_set = ForeignKey('SchedulingSet', related_name='scheduling_unit_drafts', on_delete=CASCADE, help_text='Set to which this scheduling unit draft belongs.') requirements_template = ForeignKey('SchedulingUnitTemplate', on_delete=CASCADE, help_text='Schema used for requirements_doc.') # todo: 'schema'? - observation_strategy_template = ForeignKey('SchedulingUnitObservingStrategyTemplate', on_delete=CASCADE, help_text='Observation Strategy Template used to create the requirements_doc.') + observation_strategy_template = ForeignKey('SchedulingUnitObservingStrategyTemplate', on_delete=CASCADE, null=True, help_text='Observation Strategy Template used to create the requirements_doc.') def save(self, force_insert=False, force_update=False, using=None, update_fields=None): if self.requirements_doc: diff --git a/SAS/TMSS/test/t_tmssapp_specification_REST_API.py b/SAS/TMSS/test/t_tmssapp_specification_REST_API.py index bc95e9ccebc694054c9bdc87772d8b5aab58e0bb..7f5a8f53f18e8d6354b013a2c6723f6dbde515bf 100755 --- a/SAS/TMSS/test/t_tmssapp_specification_REST_API.py +++ b/SAS/TMSS/test/t_tmssapp_specification_REST_API.py @@ -1119,7 +1119,7 @@ class SchedulingUnitDraftTestCase(unittest.TestCase): GET_OK_and_assert_equal_expected_response(self, url, schedulingunitdraft_test_data) test_patch = {"description": "This is a new and improved description", - "requirements_doc": '{"para": "meter"}'} + "requirements_doc": '{"foo": "barbar"}'} # PATCH item and verify PATCH_and_assert_expected_response(self, url, test_patch, 200, test_patch) diff --git a/SAS/TMSS/test/tmss_test_data_rest.py b/SAS/TMSS/test/tmss_test_data_rest.py index a62d9b51c566d31593e6f97d4c68baf2f285128e..72ae35943ab012631858c1dec94ebc25a25cfdd5 100644 --- a/SAS/TMSS/test/tmss_test_data_rest.py +++ b/SAS/TMSS/test/tmss_test_data_rest.py @@ -223,8 +223,8 @@ class TMSSRESTTestDataCreator(): scheduling_unit_template = self.get_response_as_json_object(template_url) requirements_doc = get_default_json_object_for_schema(scheduling_unit_template['schema']) - if observation_strategy_template_url is None: - observation_strategy_template_url = self.post_data_and_get_url(self.SchedulingUnitObservingStrategyTemplate(scheduling_unit_template_url=template_url), '/scheduling_unit_observing_strategy_template/') + # if observation_strategy_template_url is None: + # observation_strategy_template_url = self.post_data_and_get_url(self.SchedulingUnitObservingStrategyTemplate(scheduling_unit_template_url=template_url), '/scheduling_unit_observing_strategy_template/') return {"name": name, "description": "This is my run draft",