Skip to content

Commit

Permalink
Add test for #3365 fix (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
dato authored Sep 19, 2024
1 parent bee9daf commit 6745a9a
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, "January 1")

0 comments on commit 6745a9a

Please sign in to comment.