diff --git a/lemarche/tenders/migrations/0058_tenderstepsdata.py b/lemarche/tenders/migrations/0058_tenderstepsdata.py index d95fd605d..42d9cbda0 100644 --- a/lemarche/tenders/migrations/0058_tenderstepsdata.py +++ b/lemarche/tenders/migrations/0058_tenderstepsdata.py @@ -1,13 +1,12 @@ -# Generated by Django 4.2.2 on 2023-10-09 12:32 +# Generated by Django 4.2.2 on 2023-10-09 13:35 -from django.db import migrations, models import django.utils.timezone -import django_extensions.db.fields -import shortuuid.main +from django.db import migrations, models +from django_extensions.db.fields import ShortUUIDField +from shortuuid import uuid class Migration(migrations.Migration): - dependencies = [ ("tenders", "0057_alter_tender_siae_transactioned"), ] @@ -19,11 +18,11 @@ class Migration(migrations.Migration): ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), ( "uuid", - django_extensions.db.fields.ShortUUIDField( + ShortUUIDField( auto_created=True, blank=True, db_index=True, - default=shortuuid.main.ShortUUID.uuid, + default=uuid, editable=False, unique=True, verbose_name="Identifiant UUID", 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")