Fix snapshots timezone in Cloud tests (#138393)

* Fix snapshots timezone in Cloud tests

* Add explanation comment
This commit is contained in:
Abílio Costa 2025-02-17 15:01:03 +00:00 committed by GitHub
parent 4cdc3de94a
commit 9422c4de65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1943,7 +1943,10 @@ async def test_download_support_package(
)
now = dt_util.utcnow()
freezer.move_to(datetime.datetime.fromisoformat("2025-02-10T12:00:00.0+00:00"))
# The logging is done with local time according to the system timezone. Set the
# fake time to 12:00 local time
tz = now.astimezone().tzinfo
freezer.move_to(datetime.datetime(2025, 2, 10, 12, 0, 0, tzinfo=tz))
logging.getLogger("hass_nabucasa.iot").info(
"This message will be dropped since this test patches MAX_RECORDS"
)