Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.

datetime.UTC was added in Python 3.11.
This commit is contained in:
Mariusz Felisiak 2025-02-18 08:35:36 +01:00 committed by GitHub
parent 0d1dd6bba0
commit efb7f9ced2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 271 additions and 272 deletions

View file

@ -1932,7 +1932,7 @@ class AggregateTestCase(TestCase):
)
def test_aggregation_default_using_time_from_database(self):
now = timezone.now().astimezone(datetime.timezone.utc)
now = timezone.now().astimezone(datetime.UTC)
expr = Min(
"store__friday_night_closing",
filter=~Q(store__name="Amazon.com"),
@ -1984,7 +1984,7 @@ class AggregateTestCase(TestCase):
)
def test_aggregation_default_using_date_from_database(self):
now = timezone.now().astimezone(datetime.timezone.utc)
now = timezone.now().astimezone(datetime.UTC)
expr = Min("book__pubdate", default=TruncDate(NowUTC()))
queryset = Publisher.objects.annotate(earliest_pubdate=expr).order_by("name")
self.assertSequenceEqual(
@ -2045,7 +2045,7 @@ class AggregateTestCase(TestCase):
)
def test_aggregation_default_using_datetime_from_database(self):
now = timezone.now().astimezone(datetime.timezone.utc)
now = timezone.now().astimezone(datetime.UTC)
expr = Min(
"store__original_opening",
filter=~Q(store__name="Amazon.com"),