From b9e19ba234623b3f19b03489d4a230c51c3ced4e Mon Sep 17 00:00:00 2001 From: Norbert Kwizera Date: Mon, 11 Sep 2023 16:36:33 +0200 Subject: [PATCH] Fix tests --- ureport/polls/tests.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ureport/polls/tests.py b/ureport/polls/tests.py index 8efbbc82b..c26149a18 100644 --- a/ureport/polls/tests.py +++ b/ureport/polls/tests.py @@ -2158,7 +2158,11 @@ def test_contact_activity_counters(self): self.assertFalse(ContactActivity.objects.filter(org=self.nigeria, contact="contact-uuid")) self.assertFalse(ContactActivityCounter.objects.filter(org=self.nigeria)) - result_date = date(2022, 9, 15) + current_year = timezone.now().year + next_year = current_year + 1 + eight_years_ago = current_year - 8 + + result_date = date(next_year, 9, 15) PollResult.objects.create( org=self.nigeria, @@ -2201,7 +2205,7 @@ def test_contact_activity_counters(self): category="Yes", text="Yeah", completed=False, - born=2015, + born=eight_years_ago, gender="M", date=result_date, state="R-LAGOS", @@ -2218,7 +2222,7 @@ def test_contact_activity_counters(self): category="Yes", text="Yeah", completed=False, - born=2015, + born=eight_years_ago, gender="M", date=result_date, state="R-ABUJA", @@ -2235,7 +2239,7 @@ def test_contact_activity_counters(self): category="Yes", text="Yeah", completed=False, - born=2015, + born=eight_years_ago, gender="F", date=result_date, state="R-LAGOS",