Add test for #3365 fix (#5)

This commit is contained in:
Adeodato Simó 2024-09-19 11:38:33 +02:00 committed by GitHub
parent bee9dafc9d
commit 6745a9a3f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,3 +110,11 @@ class StatusDisplayTags(TestCase):
)
result = status_display.get_published_date(date)
self.assertEqual(result, "January 1")
with patch("django.utils.timezone.now") as timezone_mock:
timezone_mock.return_value = datetime.datetime(
# bookwyrm-social#3365: bug with exact month deltas
2022, 3, 1, 0, 0, tzinfo=datetime.timezone.utc
)
result = status_display.get_published_date(date)
self.assertEqual(result, "January 1")