From fcfc705b871524f00d817d69455e2538f22794dd Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Wed, 19 Jul 2023 14:08:01 -0700 Subject: [PATCH] Fixes the timezone value in a test --- src/paperless_tika/tests/test_tika_parser.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/paperless_tika/tests/test_tika_parser.py b/src/paperless_tika/tests/test_tika_parser.py index 8ba8e0e79..a1fa258a2 100644 --- a/src/paperless_tika/tests/test_tika_parser.py +++ b/src/paperless_tika/tests/test_tika_parser.py @@ -3,6 +3,11 @@ import os from pathlib import Path from unittest import mock +try: + import zoneinfo +except ImportError: + from backports import zoneinfo + from django.test import TestCase from django.test import override_settings from httpx import Request @@ -44,7 +49,10 @@ class TestTikaParser(HttpxMockMixin, TestCase): with open(self.parser.archive_path, "rb") as f: self.assertEqual(f.read(), b"PDF document") - self.assertEqual(self.parser.date, datetime.datetime(2020, 11, 21)) + self.assertEqual( + self.parser.date, + datetime.datetime(2020, 11, 21, tzinfo=zoneinfo.ZoneInfo("UTC")), + ) def test_metadata(self): self.httpx_mock.add_response(