Fixes the timezone value in a test

This commit is contained in:
Trenton H 2023-07-19 14:08:01 -07:00
parent 7bd5c010a1
commit fcfc705b87

View File

@ -3,6 +3,11 @@ import os
from pathlib import Path from pathlib import Path
from unittest import mock from unittest import mock
try:
import zoneinfo
except ImportError:
from backports import zoneinfo
from django.test import TestCase from django.test import TestCase
from django.test import override_settings from django.test import override_settings
from httpx import Request from httpx import Request
@ -44,7 +49,10 @@ class TestTikaParser(HttpxMockMixin, TestCase):
with open(self.parser.archive_path, "rb") as f: with open(self.parser.archive_path, "rb") as f:
self.assertEqual(f.read(), b"PDF document") 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): def test_metadata(self):
self.httpx_mock.add_response( self.httpx_mock.add_response(