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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user