Skip to content

Commit

Permalink
WIP: fix phone numbers related flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaupetit committed May 6, 2024
1 parent de2ed78 commit 6ea2f40
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/api/qualicharge/factories/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,26 @@ class StatiqueFactory(ModelFactory[Statique]):

contact_amenageur = Use(FrenchDataclassFactory.__faker__.ascii_company_email)
contact_operateur = Use(FrenchDataclassFactory.__faker__.ascii_company_email)
telephone_operateur = Use(FrenchDataclassFactory.__faker__.phone_number)
# FIXME
#
# Faker phone number factory randomly generates invalid data (as evaluated by the
# phonenumbers library). We choose to use a less valuable factory to avoid flaky
# tests.
#
# telephone_operateur = Use(FrenchDataclassFactory.__faker__.phone_number)
telephone_operateur = Use(
DataclassFactory.__random__.choice,
[
"+33144276350",
"+33.1 44 27 63 50",
"+33 (0)1 44 27 63 50",
"+33 1 44 27 63 50",
"0144276350",
"01 44 27 63 50",
"01-44-27-63-50",
"(01)44276350",
],
)
puissance_nominale = Use(
DataclassFactory.__faker__.pyfloat,
right_digits=2,
Expand Down

0 comments on commit 6ea2f40

Please sign in to comment.