I want to write a test, that takes a time from a saved object recipient.expiry_date
and checks that the date is 30 days in the future.
This is what I have tried:
days_to_match = timezone.now() + timedelta(days=30)
self.assertEqual(recipient.expiry_date, days_to_match)
Because it also contains the time this won't match.
How can this be done?
Please note that recipient.expiry_date
is set in my model using timezone.now()
so comparison on dates from python seemed to error.