Skip to content

Commit 863e970

Browse files
committed
test: fix flaky test
Force the second address to have some other municipality than Helsinki to avoid faker generating Helsinki for it with a 1 / 308 chance.
1 parent b77f3e9 commit 863e970

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

address/tests/test_api_views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ def test_filter_addresses_by_street_letter(api_client: APIClient):
8787
@mark.django_db
8888
def test_filter_addresses_by_municipality(api_client: APIClient):
8989
municipality = MunicipalityFactory(name="Helsinki")
90+
other_municipality = MunicipalityFactory(name="Turpere")
9091
match = AddressFactory(municipality=municipality)
91-
AddressFactory()
92+
AddressFactory(municipality=other_municipality)
9293
serializer = AddressSerializer()
9394
response = api_client.get(
9495
reverse("address:address-list"), {"municipality": municipality.name}

0 commit comments

Comments
 (0)