diff options
| author | Carlton Gibson <carlton.gibson@noumenal.es> | 2022-03-23 12:15:36 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-03-24 06:29:50 +0100 |
| commit | bb61f0186d5c490caa44f3e3672d81e14414d33c (patch) | |
| tree | 71e682d415e4640fd1e950af0e4921b2af57ea60 /tests/utils_tests/test_dateformat.py | |
| parent | 1cf60ce6017d904024ee132f7edae0b4b821a954 (diff) | |
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.
Diffstat (limited to 'tests/utils_tests/test_dateformat.py')
| -rw-r--r-- | tests/utils_tests/test_dateformat.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/utils_tests/test_dateformat.py b/tests/utils_tests/test_dateformat.py index 4e4926c85b..4402048f3a 100644 --- a/tests/utils_tests/test_dateformat.py +++ b/tests/utils_tests/test_dateformat.py @@ -1,15 +1,10 @@ -from datetime import date, datetime, time, tzinfo +from datetime import date, datetime, time, timezone, tzinfo from django.test import SimpleTestCase, override_settings from django.test.utils import TZ_SUPPORT, requires_tz_support from django.utils import dateformat, translation from django.utils.dateformat import format -from django.utils.timezone import ( - get_default_timezone, - get_fixed_timezone, - make_aware, - utc, -) +from django.utils.timezone import get_default_timezone, get_fixed_timezone, make_aware @override_settings(TIME_ZONE="Europe/Copenhagen") @@ -71,7 +66,7 @@ class DateFormatTests(SimpleTestCase): ) def test_epoch(self): - udt = datetime(1970, 1, 1, tzinfo=utc) + udt = datetime(1970, 1, 1, tzinfo=timezone.utc) self.assertEqual(format(udt, "U"), "0") def test_empty_format(self): @@ -216,7 +211,7 @@ class DateFormatTests(SimpleTestCase): @requires_tz_support def test_e_format_with_named_time_zone(self): - dt = datetime(1970, 1, 1, tzinfo=utc) + dt = datetime(1970, 1, 1, tzinfo=timezone.utc) self.assertEqual(dateformat.format(dt, "e"), "UTC") @requires_tz_support |
