mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.
datetime.UTC was added in Python 3.11.
This commit is contained in:
@@ -2428,7 +2428,7 @@ class SchemaTests(TransactionTestCase):
|
||||
data = JSONField(
|
||||
encoder=DjangoJSONEncoder,
|
||||
db_default={
|
||||
"epoch": datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc)
|
||||
"epoch": datetime.datetime(1970, 1, 1, tzinfo=datetime.UTC)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -5315,7 +5315,7 @@ class SchemaTests(TransactionTestCase):
|
||||
"""
|
||||
now = datetime.datetime(month=1, day=1, year=2000, hour=1, minute=1)
|
||||
now_tz = datetime.datetime(
|
||||
month=1, day=1, year=2000, hour=1, minute=1, tzinfo=datetime.timezone.utc
|
||||
month=1, day=1, year=2000, hour=1, minute=1, tzinfo=datetime.UTC
|
||||
)
|
||||
mocked_datetime.now = mock.MagicMock(return_value=now)
|
||||
mocked_tz.now = mock.MagicMock(return_value=now_tz)
|
||||
|
||||
Reference in New Issue
Block a user