1
0
mirror of https://github.com/django/django.git synced 2025-04-03 13:06:49 +00:00

ticket #34699. code formatting update.

This commit is contained in:
wesley 2024-10-09 18:24:21 -04:00
parent 4d2bb0e10b
commit 201fb15795

View File

@ -1952,12 +1952,12 @@ class DateFunctionWithTimeZoneTests(DateFunctionTests):
later = now + timedelta(hours=2)
non_utc_model = self.create_model(now, later)
models_qs = DTModel.objects.annotate(
start_trunc=TruncSecond('start_datetime')).filter(id=non_utc_model.id,
start_trunc__lte=now)
start_trunc=TruncSecond('start_datetime')
).filter(id=non_utc_model.id, start_trunc__lte=now)
self.assertEqual(models_qs.count(), 1)
test_timezones = [
zoneinfo.ZoneInfo("Europe/Berlin"),
zoneinfo.ZoneInfo("Australia/Melbourne")
zoneinfo.ZoneInfo("Australia/Melbourne"),
]
for test_tz in test_timezones:
with timezone.override(test_tz):
@ -1965,14 +1965,13 @@ class DateFunctionWithTimeZoneTests(DateFunctionTests):
later = now + timedelta(hours=2)
non_utc_model = self.create_model(now, later)
models_qs = DTModel.objects.annotate(
start_trunc=TruncSecond('start_datetime')).filter(
id=non_utc_model.id,
start_trunc__lte=now)
start_trunc=TruncSecond('start_datetime')
).filter(id=non_utc_model.id, start_trunc__lte=now)
self.assertNotEqual(models_qs.count(), 1)
adjusted_now = timezone.localtime(now).replace(
tzinfo=zoneinfo.ZoneInfo(key='UTC'))
tzinfo=zoneinfo.ZoneInfo(key='UTC')
)
models_qs = DTModel.objects.annotate(
start_trunc=TruncSecond('start_datetime')).filter(
id=non_utc_model.id,
start_trunc__lte=adjusted_now)
start_trunc=TruncSecond('start_datetime')
).filter(id=non_utc_model.id, start_trunc__lte=adjusted_now)
self.assertEqual(models_qs.count(), 1)