1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +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:
Mariusz Felisiak
2025-02-18 08:35:36 +01:00
committed by GitHub
parent 0d1dd6bba0
commit efb7f9ced2
41 changed files with 271 additions and 272 deletions

View File

@@ -1,4 +1,4 @@
from datetime import datetime, timezone
from datetime import UTC, datetime
from django.conf import settings
from django.contrib.auth import aauthenticate, authenticate
@@ -197,7 +197,7 @@ class RemoteUserTest(TestCase):
# Set last_login to something so we can determine if it changes.
default_login = datetime(2000, 1, 1)
if settings.USE_TZ:
default_login = default_login.replace(tzinfo=timezone.utc)
default_login = default_login.replace(tzinfo=UTC)
user.last_login = default_login
user.save()
@@ -216,7 +216,7 @@ class RemoteUserTest(TestCase):
# Set last_login to something so we can determine if it changes.
default_login = datetime(2000, 1, 1)
if settings.USE_TZ:
default_login = default_login.replace(tzinfo=timezone.utc)
default_login = default_login.replace(tzinfo=UTC)
user.last_login = default_login
await user.asave()