Skip to content

Commit a110dab

Browse files
committed
✅(api) add tests for operateur phone numbers
We observed flaky tests, but are not able to reproduce them.
1 parent d8995be commit a110dab

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/api/tests/schemas/test_static.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@
2121
from qualicharge.schemas.static import Amenageur, Localisation
2222

2323

24+
@pytest.mark.parametrize(
25+
"phone_number",
26+
(
27+
"+33144276350",
28+
"+33.1 44 27 63 50",
29+
"+33 (0)1 44 27 63 50",
30+
"+33 1 44 27 63 50",
31+
"0144276350",
32+
"01 44 27 63 50",
33+
"01-44-27-63-50",
34+
"(01)44276350",
35+
),
36+
)
37+
def test_operateur_phone_numbers(phone_number):
38+
"""Test Operator schema accepted phone number formats."""
39+
operateur = OperateurFactory.build(telephone_operateur=phone_number)
40+
assert operateur.telephone_operateur == "tel:+33-1-44-27-63-50"
41+
42+
2443
def test_localisation_schema_set_geometry_point_validator(db_session):
2544
"""Test the Localisation schema `set_geometry_point` validator."""
2645
# Create and save a new location

0 commit comments

Comments
 (0)