Avoid use of datetime.utc* methods deprecated in Python 3.12 (#93684)

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
This commit is contained in:
Ville Skyttä
2023-08-24 17:38:22 +03:00
committed by GitHub
parent 61c17291fb
commit 9da192c752
18 changed files with 57 additions and 54 deletions

View File

@@ -1,5 +1,4 @@
"""The tests for the Traccar device tracker platform."""
from datetime import datetime
from unittest.mock import AsyncMock, patch
from pytraccar import ReportsEventeModel
@@ -17,6 +16,7 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
from homeassistant.util import dt as dt_util
from tests.common import async_capture_events
@@ -47,7 +47,7 @@ async def test_import_events_catch_all(hass: HomeAssistant) -> None:
"maintenanceId": 1,
"deviceId": device["id"],
"type": "ignitionOn",
"eventTime": datetime.utcnow().isoformat(),
"eventTime": dt_util.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"),
"attributes": {},
}
),
@@ -59,7 +59,7 @@ async def test_import_events_catch_all(hass: HomeAssistant) -> None:
"maintenanceId": 1,
"deviceId": device["id"],
"type": "ignitionOff",
"eventTime": datetime.utcnow().isoformat(),
"eventTime": dt_util.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"),
"attributes": {},
}
),