Skip to content

Commit

Permalink
fixed test_delete_messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Mudiwa Matanda authored and Mudiwa Matanda committed Jul 31, 2024
1 parent a04aaed commit 80e02c8
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,23 @@ def test_invalid_arguments(self):
self.assertRaises(Exception, self.call_command, "InvalidModel")

def test_delete_events(self):
running_month = timezone.now() - relativedelta(months=12, hour=12)
running_month = timezone.now() - relativedelta(days=365, hour=12)

for i in range(12):
self.create_record(Event, i, running_month)
running_month = running_month + relativedelta(months=1)
running_month = running_month + relativedelta(days=31)

self.call_command("Event", 6)

self.assertEqual(Event.objects.count(), 6)

def test_delete_messages(self):
running_month = timezone.now() - relativedelta(months=12, hour=12)

running_month = timezone.now() - relativedelta(days=365, hour=12)
for i in range(12):
self.create_record(Message, i, running_month)
running_month = running_month + relativedelta(months=1)
running_month = running_month + relativedelta(days=31)
print(f" running month: {running_month}")

self.call_command("Message", 6)

Expand Down

0 comments on commit 80e02c8

Please sign in to comment.