Skip to content

Commit

Permalink
Fix flaky tests (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
eadpearce authored Sep 14, 2023
1 parent 5c94241 commit 3fef8f6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions geo_areas/tests/bdd/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
"geographical_area 1001 with a description and area_code 0",
target_fixture="geographical_area_1001",
)
def geographical_area_1001():
def geographical_area_1001(date_ranges):
area = factories.GeographicalAreaFactory(id=1001, area_id=1001, area_code=0)
factories.GeographicalAreaDescriptionFactory(
described_geographicalarea=area,
description="This is 1001",
validity_start=date_ranges.earlier.lower,
)
factories.GeographicalAreaDescriptionFactory(
described_geographicalarea=factories.GeographicalMembershipFactory(
member=area,
).geo_group,
description="random group description",
validity_start=date_ranges.normal.lower,
)
return area

Expand All @@ -26,14 +28,23 @@ def geographical_area_1001():
"geographical_area 1002 with a description and area_code 1",
target_fixture="geographical_area_1002",
)
def geographical_area_1002(geographical_area_1001):
area = factories.GeographicalAreaFactory(id=1002, area_id=1002, area_code=1)
def geographical_area_1002(geographical_area_1001, date_ranges):
area = factories.GeographicalAreaFactory(
id=1002,
area_id=1002,
area_code=1,
valid_between=date_ranges.big_no_end,
description=None,
)
factories.GeographicalAreaDescriptionFactory(
described_geographicalarea=area,
description="This is 1002",
validity_start=date_ranges.normal.lower,
transaction=area.transaction,
)
factories.GeographicalMembershipFactory(
member=geographical_area_1001,
geo_group=area,
transaction=area.transaction,
)
return area

0 comments on commit 3fef8f6

Please sign in to comment.