From bb61f0186d5c490caa44f3e3672d81e14414d33c Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Wed, 23 Mar 2022 12:15:36 +0100 Subject: Refs #32365 -- Removed internal uses of utils.timezone.utc alias. Remaining test case ensures that uses of the alias are mapped canonically by the migration writer. --- tests/staticfiles_tests/storage.py | 3 +-- tests/staticfiles_tests/test_management.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/staticfiles_tests') diff --git a/tests/staticfiles_tests/storage.py b/tests/staticfiles_tests/storage.py index 1bb4e37485..51614fbb18 100644 --- a/tests/staticfiles_tests/storage.py +++ b/tests/staticfiles_tests/storage.py @@ -1,10 +1,9 @@ import os -from datetime import datetime, timedelta +from datetime import datetime, timedelta, timezone from django.conf import settings from django.contrib.staticfiles.storage import ManifestStaticFilesStorage from django.core.files import storage -from django.utils import timezone class DummyStorage(storage.Storage): diff --git a/tests/staticfiles_tests/test_management.py b/tests/staticfiles_tests/test_management.py index 09ce7c488c..6dec3a67bd 100644 --- a/tests/staticfiles_tests/test_management.py +++ b/tests/staticfiles_tests/test_management.py @@ -17,7 +17,6 @@ from django.core.management import CommandError, call_command from django.core.management.base import SystemCheckError from django.test import RequestFactory, override_settings from django.test.utils import extend_sys_path -from django.utils import timezone from django.utils._os import symlinks_supported from django.utils.functional import empty @@ -531,7 +530,7 @@ class TestCollectionNonLocalStorage(TestNoFilesCreated, CollectionTestCase): storage = DummyStorage() self.assertEqual( storage.get_modified_time("name"), - datetime.datetime(1970, 1, 1, tzinfo=timezone.utc), + datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc), ) with self.assertRaisesMessage( NotImplementedError, "This backend doesn't support absolute paths." -- cgit v1.2.1