From a404280dc85067813f5751ac5476344ac353605d Mon Sep 17 00:00:00 2001 From: Michael Beaton Date: Fri, 2 Feb 2024 18:04:37 +0000 Subject: [PATCH] Fixed missing datetime tzinfo. --- .../test_model_resolution/test_resolve_from_url_kwargs.py | 4 ++-- .../urlpatterns/test_with_urlpattern_helpers.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/tests/test_model_resolution/test_resolve_from_url_kwargs.py b/tests/tests/test_model_resolution/test_resolve_from_url_kwargs.py index 54612f5..49016d1 100644 --- a/tests/tests/test_model_resolution/test_resolve_from_url_kwargs.py +++ b/tests/tests/test_model_resolution/test_resolve_from_url_kwargs.py @@ -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( @@ -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): diff --git a/tests/tests/test_model_resolution/urlpatterns/test_with_urlpattern_helpers.py b/tests/tests/test_model_resolution/urlpatterns/test_with_urlpattern_helpers.py index 5aa3677..5b9fab4 100644 --- a/tests/tests/test_model_resolution/urlpatterns/test_with_urlpattern_helpers.py +++ b/tests/tests/test_model_resolution/urlpatterns/test_with_urlpattern_helpers.py @@ -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,