Skip to content

Commit

Permalink
✅(api) add tests for operateur phone numbers
Browse files Browse the repository at this point in the history
We observed flaky tests, but are not able to reproduce them.
  • Loading branch information
jmaupetit committed Apr 23, 2024
1 parent d8995be commit 63841e4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/api/tests/schemas/test_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@
from qualicharge.schemas.static import Amenageur, Localisation


@pytest.mark.parametrize(
"phone_number",
(
"+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",
),
)
def test_operateur_phone_numbers(phone_number):
"""Test Operator schema accepted phone number formats."""
operateur = OperateurFactory.build(telephone_operateur=phone_number)
assert operateur.telephone_operateur == "tel:+33-1-44-27-63-50"


def test_localisation_schema_set_geometry_point_validator(db_session):
"""Test the Localisation schema `set_geometry_point` validator."""
# Create and save a new location
Expand Down

0 comments on commit 63841e4

Please sign in to comment.