Skip to content

Commit

Permalink
Merge pull request #992 from lakridserne/bug/invite_many_test_fails
Browse files Browse the repository at this point in the history
Update test to use dynamic years
  • Loading branch information
lakridserne authored Jan 14, 2024
2 parents 4d1cfa4 + e587cce commit 4d9bac6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions members/tests/test_admin_admin_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def setUp(self):

# logic for inviting is based on activity date, not current date, so we use fixed dates
self.activity = Activity(
start_date=datetime.fromisoformat("2023-01-01"),
end_date=datetime.fromisoformat("2023-12-31"),
start_date=datetime.fromisoformat(str(datetime.now().year) + "-01-01"),
end_date=datetime.fromisoformat(str(datetime.now().year) + "-12-31"),
min_age=7,
max_age=17,
department=self.department,
Expand All @@ -49,19 +49,19 @@ def setUp(self):
self.family.save()

self.person_too_young = self.create_person_and_waiting_list_entry(
"2018-01-01"
str(datetime.now().year - 5) + "-01-01"
) # 5 years old
self.person_exactly_start_age = self.create_person_and_waiting_list_entry(
"2016-01-01"
str(datetime.now().year - 7) + "-01-01"
) # 7 years old
self.person_correct_age = self.create_person_and_waiting_list_entry(
"2013-01-01"
str(datetime.now().year - 10) + "-01-01"
) # 10 years old
self.person_exactly_end_age = self.create_person_and_waiting_list_entry(
"2006-01-01"
str(datetime.now().year - 17) + "-01-01"
) # 17 years old
self.person_too_old = self.create_person_and_waiting_list_entry(
"2005-01-01"
str(datetime.now().year - 18) + "-01-01"
) # 18 years old

# setup email template
Expand Down

0 comments on commit 4d9bac6

Please sign in to comment.