From 7ee7757c3b765178a2f43b9615832accd07ba1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Mon, 9 Oct 2023 15:09:00 +0200 Subject: [PATCH] add tests to check steps data --- lemarche/www/tenders/tests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lemarche/www/tenders/tests.py b/lemarche/www/tenders/tests.py index e99dc36e6..ca17813a1 100644 --- a/lemarche/www/tenders/tests.py +++ b/lemarche/www/tenders/tests.py @@ -18,7 +18,7 @@ from lemarche.siaes.models import Siae from lemarche.tenders import constants as tender_constants from lemarche.tenders.factories import TenderFactory, TenderQuestionFactory -from lemarche.tenders.models import Tender, TenderSiae +from lemarche.tenders.models import Tender, TenderSiae, TenderStepsData from lemarche.users.factories import UserFactory from lemarche.users.models import User from lemarche.www.tenders.views import TenderCreateMultiStepView @@ -89,6 +89,13 @@ def _check_every_step(self, tenders_step_data, final_redirect_page: str = revers current_errors = response.context_data["form"].errors self.assertEquals(current_errors, {}) + # Is the step data stored correctly ? + tender_step_data = TenderStepsData.objects.first() + self.assertEqual( + data_step["tender_create_multi_step_view-current_step"], + tender_step_data.steps_data[-1]["tender_create_multi_step_view-current_step"], + ) + def test_anyone_can_access_create_tender(self): # anonymous url = reverse("tenders:create")