From 6531e5c26053d6c615d509f39ca8cfb3db210f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Lesage?= <tlesage@teklia.com> Date: Thu, 25 Apr 2024 17:26:39 +0200 Subject: [PATCH] Finished keep original_task in restarted task --- arkindex/documents/tests/tasks/test_corpus_delete.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arkindex/documents/tests/tasks/test_corpus_delete.py b/arkindex/documents/tests/tasks/test_corpus_delete.py index 527431b3f5..5a0e02f3c5 100644 --- a/arkindex/documents/tests/tasks/test_corpus_delete.py +++ b/arkindex/documents/tests/tasks/test_corpus_delete.py @@ -49,7 +49,7 @@ class TestDeleteCorpus(FixtureTestCase): ) element_process.elements.add(element) worker_run = element_process.worker_runs.create(version=cls.worker_version, parents=[]) - task_1, task_2, task_3 = Task.objects.bulk_create( + task_1, task_2, task_3, task_4 = Task.objects.bulk_create( [ Task( run=0, @@ -58,11 +58,15 @@ class TestDeleteCorpus(FixtureTestCase): worker_run=worker_run, slug=f"unscheduled task {i}", state=State.Unscheduled, - ) for i in range(1, 4) + ) for i in range(0, 4) ] ) task_1.parents.set([task_2]) task_3.parents.set([task_1, task_2]) + task_3.slug += "_old1" + task_4.original_task_id = task_3.id + task_3.save() + task_4.save() element.worker_run = worker_run element.worker_version = cls.worker_version element.save() -- GitLab