Skip to content

Commit f26c407

Browse files
committed
attempt fix for flaky test
1 parent 03c459f commit f26c407

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

mondey_backend/tests/conftest.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def children():
8888

8989
nine_months_ago = today - relativedelta(months=9)
9090
twenty_months_ago = today - relativedelta(months=20)
91-
91+
fiftyfive_months_ago = today - relativedelta(months=55)
9292
return [
9393
# ~9month old child for user (id 3)
9494
{
@@ -110,8 +110,8 @@ def children():
110110
},
111111
# ~5 year old child for admin user (id 1)
112112
{
113-
"birth_month": 7,
114-
"birth_year": today.year - 5,
113+
"birth_month": fiftyfive_months_ago.month,
114+
"birth_year": fiftyfive_months_ago.year,
115115
"id": 3,
116116
"name": "child3",
117117
"has_image": True,

mondey_backend/tests/utils/test_utils.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,4 @@ def test_get_answer_session_child_ages_in_months(session):
2828
assert len(child_ages) == 3
2929
assert child_ages[1] == 8
3030
assert child_ages[2] == 8
31-
assert (
32-
child_ages[3] in [55, 56]
33-
) # 55 or 56 months. hacky fix for a recurrent issue with datetime and months of different lengths. TODO: fix that properly in a separate branch.
31+
assert child_ages[3] == 55

0 commit comments

Comments
 (0)