1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #32365 -- Removed django.utils.timezone.utc per deprecation timeline.

This commit is contained in:
Mariusz Felisiak
2023-01-13 08:22:41 +01:00
parent 9a01311d20
commit d6816bff73
7 changed files with 15 additions and 67 deletions

View File

@@ -33,7 +33,6 @@ from django.test import (
from django.test.utils import requires_tz_support
from django.urls import reverse
from django.utils import timezone, translation
from django.utils.deprecation import RemovedInDjango50Warning
from django.utils.timezone import timedelta
from .forms import (
@@ -74,19 +73,6 @@ EAT = timezone.get_fixed_timezone(180) # Africa/Nairobi
ICT = timezone.get_fixed_timezone(420) # Asia/Bangkok
class UTCAliasTests(SimpleTestCase):
def test_alias_deprecation_warning(self):
msg = (
"The django.utils.timezone.utc alias is deprecated. "
"Please update your code to use datetime.timezone.utc instead."
)
with self.assertRaisesMessage(RemovedInDjango50Warning, msg):
timezone.utc
def test_timezone_module_dir_includes_utc(self):
self.assertIn("utc", dir(timezone))
@contextmanager
def override_database_connection_timezone(timezone):
try: