From ec38012ecbcd2db05884d8210fdf48a1aac022fd Mon Sep 17 00:00:00 2001 From: moanos Date: Fri, 22 Nov 2024 18:49:19 +0100 Subject: [PATCH] test: fix test by setting date of last checked correctly --- src/tests/test_admin_tasks.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tests/test_admin_tasks.py b/src/tests/test_admin_tasks.py index 0ed895c..c50a5a6 100644 --- a/src/tests/test_admin_tasks.py +++ b/src/tests/test_admin_tasks.py @@ -19,16 +19,18 @@ class DeactivationTest(TestCase): cls.adoption1 = baker.make(AdoptionNotice, name="TestAdoption1", - created_at=more_than_three_weeks_ago, - last_checked=more_than_three_weeks_ago) + created_at=more_than_three_weeks_ago) cls.adoption2 = baker.make(AdoptionNotice, name="TestAdoption2") cls.adoption3 = baker.make(AdoptionNotice, name="TestAdoption3", - created_at=less_than_three_weeks_ago, - last_checked=less_than_three_weeks_ago) + created_at=less_than_three_weeks_ago) cls.adoption1.set_active() + cls.adoption1.last_checked = more_than_three_weeks_ago # Reset updated_at to simulate test conditions + cls.adoption1.save() cls.adoption3.set_active() + cls.adoption3.last_checked = less_than_three_weeks_ago # Reset updated_at to simulate test conditions + cls.adoption3.save() def test_get_unchecked_adoption_notices(self): result = get_unchecked_adoption_notices()