Skip to content

Commit

Permalink
Fixed missing datetime tzinfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
beatonma committed Feb 2, 2024
1 parent 0555e13 commit a404280
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class GetModelForUrlWithCustomObjectResolution(WebmentionTestCase):

def setUp(self) -> None:
super().setUp()
self.published = timezone.datetime(2022, 3, 28, 9, 3, 2)
self.published = timezone.datetime(2022, 3, 28, 9, 3, 2, tzinfo=timezone.get_current_timezone())

blog = SampleBlog.objects.create(slug="blogslug")
MentionableTestBlogPost.objects.create(
Expand All @@ -92,7 +92,7 @@ def setUp(self) -> None:
blog=blog,
content="hello am decoy",
slug="testpostslug",
timestamp=timezone.datetime(2022, 3, 27, 9, 3, 2),
timestamp=timezone.datetime(2022, 3, 27, 9, 3, 2, tzinfo=timezone.get_current_timezone()),
)

def test_get_model_for_url__with_custom_lookup(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ def test_mentions_path_resolves_model(self):
self.assertEqual(obj, retrieved_obj)

def test_mentions_path_with_complex_mapping_resolves_model(self):
published = timezone.datetime(2022, 3, 28, 9, 3, 2)
published = timezone.datetime(2022, 3, 28, 9, 3, 2, tzinfo=timezone.get_current_timezone())

blog = SampleBlog.objects.create(slug="blog-slug")
MentionableTestBlogPost.objects.create(
blog=blog,
content="hello am decoy",
slug="testpostslug",
timestamp=timezone.datetime(2022, 3, 27, 9, 3, 2),
timestamp=timezone.datetime(2022, 3, 27, 9, 3, 2, tzinfo=timezone.get_current_timezone()),
)
MentionableTestBlogPost.objects.create(
blog=blog,
Expand Down

0 comments on commit a404280

Please sign in to comment.