From efb7f9ced2dcf71294353596a265e3fd67faffeb Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 18 Feb 2025 08:35:36 +0100 Subject: Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc. datetime.UTC was added in Python 3.11. --- tests/auth_tests/test_remote_user.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/auth_tests/test_remote_user.py') diff --git a/tests/auth_tests/test_remote_user.py b/tests/auth_tests/test_remote_user.py index 85de931c1a..67748d6c23 100644 --- a/tests/auth_tests/test_remote_user.py +++ b/tests/auth_tests/test_remote_user.py @@ -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() -- cgit v1.3