From ec07c0c6b4963d728768b0859443fdec96562c6a Mon Sep 17 00:00:00 2001 From: Jorrit Schaap <schaap@astron.nl> Date: Tue, 22 Dec 2020 07:42:46 +0100 Subject: [PATCH] TMSS-320: random name if none given --- SAS/TMSS/test/tmss_test_data_django_models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SAS/TMSS/test/tmss_test_data_django_models.py b/SAS/TMSS/test/tmss_test_data_django_models.py index a19c65bfcd6..360a4a90b3f 100644 --- a/SAS/TMSS/test/tmss_test_data_django_models.py +++ b/SAS/TMSS/test/tmss_test_data_django_models.py @@ -240,7 +240,10 @@ def SchedulingUnitBlueprint_test_data(name=None, requirements_template: models.S "do_cancel": False, "draft": models.SchedulingUnitDraft.objects.create(**SchedulingUnitDraft_test_data()) } -def TaskBlueprint_test_data(name='my_task_blueprint', task_draft: models.TaskDraft = None, scheduling_unit_blueprint: models.SchedulingUnitBlueprint = None, specifications_template: models.TaskTemplate=None, specifications_doc: dict=None) -> dict: +def TaskBlueprint_test_data(name: str=None, task_draft: models.TaskDraft = None, scheduling_unit_blueprint: models.SchedulingUnitBlueprint = None, specifications_template: models.TaskTemplate=None, specifications_doc: dict=None) -> dict: + if name is None: + name = str(uuid.uuid4()) + if scheduling_unit_blueprint is None: scheduling_unit_blueprint = models.SchedulingUnitBlueprint.objects.create(**SchedulingUnitBlueprint_test_data()) -- GitLab