From 6745a9a3f528c5ab2db24aa63522fa9cbe3f9301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= <73768+dato@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:38:33 +0200 Subject: [PATCH] Add test for #3365 fix (#5) --- bookwyrm/tests/templatetags/test_status_display.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bookwyrm/tests/templatetags/test_status_display.py b/bookwyrm/tests/templatetags/test_status_display.py index 169243c0d..e62b75f37 100644 --- a/bookwyrm/tests/templatetags/test_status_display.py +++ b/bookwyrm/tests/templatetags/test_status_display.py @@ -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")