Skip to content

Commit

Permalink
Add test for bookwyrm-social#3365 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dato committed Sep 18, 2024
1 parent bee9daf commit 8a27645
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bookwyrm/tests/templatetags/test_status_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,11 @@ def test_get_published_date(self, *_):
)
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, "Jan 1")

0 comments on commit 8a27645

Please sign in to comment.