Confirm support for Django 4.1

Replaces deprecated `django.utils.timezone.utc` with
`datetime.timezone.utc` (available since Python 3.2).
This commit is contained in:
Tim Schilling
2022-08-24 15:24:27 -05:00
committed by GitHub
parent 6b3775a8e9
commit a4f50c4340
25 changed files with 80 additions and 89 deletions

View File

@@ -1,11 +1,10 @@
import json
from datetime import datetime
from datetime import datetime, timezone
from io import BytesIO
from textwrap import dedent
from unittest.mock import ANY
from django.test import override_settings, tag
from django.utils.timezone import utc
from anymail.exceptions import AnymailConfigurationError
from anymail.inbound import AnymailInboundMessage
@@ -62,7 +61,7 @@ class MailgunInboundTestCase(WebhookTestCase):
event = kwargs['event']
self.assertIsInstance(event, AnymailInboundEvent)
self.assertEqual(event.event_type, 'inbound')
self.assertEqual(event.timestamp, datetime(2016, 4, 21, 17, 55, 30, tzinfo=utc))
self.assertEqual(event.timestamp, datetime(2016, 4, 21, 17, 55, 30, tzinfo=timezone.utc))
self.assertEqual(event.event_id, "06c96bafc3f42a66b9edd546347a2fe18dc23461fe80dc52f0")
self.assertIsInstance(event.message, AnymailInboundMessage)
self.assertEqual(querydict_to_postdict(event.esp_event.POST), raw_event)