diff options
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 c45f078ef6..815da17026 100644 --- a/tests/timezones/tests.py +++ b/tests/timezones/tests.py @@ -65,7 +65,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 = datetime.timezone.utc +UTC = datetime.UTC EAT = timezone.get_fixed_timezone(180) # Africa/Nairobi ICT = timezone.get_fixed_timezone(420) # Asia/Bangkok @@ -618,7 +618,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, datetime.timezone.utc) + utc_naive_dt = timezone.make_naive(dt, UTC) with connection.cursor() as cursor: cursor.execute( "INSERT INTO timezones_event (dt) VALUES (%s)", [utc_naive_dt] @@ -637,7 +637,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, datetime.timezone.utc) + utc_naive_dt = timezone.make_naive(dt, UTC) Event.objects.create(dt=dt) with connection.cursor() as cursor: cursor.execute( |
