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/timezones | |
parent | 1cf60ce6017d904024ee132f7edae0b4b821a954 (diff) | |
download | django-bb61f0186d5c490caa44f3e3672d81e14414d33c.tar.gz |
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/timezones')
-rw-r--r-- | tests/timezones/tests.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/timezones/tests.py b/tests/timezones/tests.py index 75c79ecfdd..4e26516041 100644 --- a/tests/timezones/tests.py +++ b/tests/timezones/tests.py @@ -75,7 +75,7 @@ except ImportError: # datetime.datetime(2011, 9, 1, 13, 20, 30), which translates to # 10:20:30 in UTC and 17:20:30 in ICT. -UTC = timezone.utc +UTC = datetime.timezone.utc EAT = timezone.get_fixed_timezone(180) # Africa/Nairobi ICT = timezone.get_fixed_timezone(420) # Asia/Bangkok @@ -651,7 +651,7 @@ class NewDatabaseTests(TestCase): @skipIfDBFeature("supports_timezones") def test_cursor_execute_accepts_naive_datetime(self): dt = datetime.datetime(2011, 9, 1, 13, 20, 30, tzinfo=EAT) - utc_naive_dt = timezone.make_naive(dt, timezone.utc) + utc_naive_dt = timezone.make_naive(dt, datetime.timezone.utc) with connection.cursor() as cursor: cursor.execute( "INSERT INTO timezones_event (dt) VALUES (%s)", [utc_naive_dt] @@ -670,7 +670,7 @@ class NewDatabaseTests(TestCase): @skipIfDBFeature("supports_timezones") def test_cursor_execute_returns_naive_datetime(self): dt = datetime.datetime(2011, 9, 1, 13, 20, 30, tzinfo=EAT) - utc_naive_dt = timezone.make_naive(dt, timezone.utc) + utc_naive_dt = timezone.make_naive(dt, datetime.timezone.utc) Event.objects.create(dt=dt) with connection.cursor() as cursor: cursor.execute( |