Migrate auth tests to use freezegun (#105243)

This commit is contained in:
Jan-Philipp Benecke 2023-12-07 21:18:10 +01:00 committed by GitHub
parent 2daa94b600
commit 6666b796f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 18 deletions

View file

@ -894,10 +894,7 @@ async def test_auth_module_expired_session(mock_hass) -> None:
assert step["type"] == data_entry_flow.FlowResultType.FORM
assert step["step_id"] == "mfa"
with patch(
"homeassistant.util.dt.utcnow",
return_value=dt_util.utcnow() + MFA_SESSION_EXPIRATION,
):
with freeze_time(dt_util.utcnow() + MFA_SESSION_EXPIRATION):
step = await manager.login_flow.async_configure(
step["flow_id"], {"pin": "test-pin"}
)