From 38e3afba8629ee2f1cdbe35a05126577a6d577df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 5 Mar 2020 22:59:00 +0100 Subject: [PATCH] Do not re-use children task instance in test scenario The task instance is not updated when the parent project is saved. So it keep the former timestamp in memory which raise concurrency exceptions. issue9101 --- tests/scenario_project_status.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/scenario_project_status.rst b/tests/scenario_project_status.rst index 47f6cfee84..422d117d77 100644 --- a/tests/scenario_project_status.rst +++ b/tests/scenario_project_status.rst @@ -56,12 +56,13 @@ Try to complete project without task:: ... WorkProgressValidationError: ... + >>> task, = project.children >>> task.progress = 1 - >>> task.save() >>> project.save() Try to re-open task without project:: + >>> task = Work(task.id) >>> task.progress = 0.5 >>> task.save() # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): @@ -81,5 +82,6 @@ Change progress with updating status:: Re-open task:: + >>> task = Work(task.id) >>> task.progress = 0.5 >>> task.save()