Skip to content

Commit

Permalink
Fix flacky test with fuzzy regions and department
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilouf committed Jan 2, 2025
1 parent 1010bd7 commit 2c1c67f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lemarche/siaes/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class Meta:
address = factory.Faker("street_address", locale="fr_FR")
city = factory.Faker("city", locale="fr_FR")
post_code = factory.Faker("postalcode")
department = factory.fuzzy.FuzzyChoice([key for (key, value) in Siae.DEPARTMENT_CHOICES])
region = factory.fuzzy.FuzzyChoice([key for (key, value) in Siae.REGION_CHOICES])
department = "35"
region = "Bretagne"
contact_email = factory.Sequence("siae_contact_email{0}@beta.gouv.fr".format)
contact_first_name = factory.Faker("name", locale="fr_FR")
contact_last_name = factory.Faker("name", locale="fr_FR")
Expand Down
4 changes: 3 additions & 1 deletion lemarche/siaes/tests/test_commands.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import factory
import logging
import os
from unittest.mock import patch

import factory
from django.core.management import call_command
from django.db.models import signals
from django.test import TransactionTestCase
Expand Down Expand Up @@ -328,6 +328,7 @@ def test_create_activities_failed_with_department(self):
kind=siae_constants.KIND_EA,
presta_type=[siae_constants.PRESTA_DISP],
geo_range=siae_constants.GEO_RANGE_DEPARTMENT,
department="35",
)
siae.sectors.set([self.sector2, self.sector3])

Expand All @@ -346,6 +347,7 @@ def test_create_activities_failed_with_region(self):
kind=siae_constants.KIND_EA,
presta_type=[siae_constants.PRESTA_DISP],
geo_range=siae_constants.GEO_RANGE_REGION,
region="Bretagne",
)
siae.sectors.set([self.sector2, self.sector3])

Expand Down

0 comments on commit 2c1c67f

Please sign in to comment.