Aware comments (#15480)
* Make sure we cannot deactivate the owner * Use different error code when trying to fetch token for inactive user
This commit is contained in:
parent
5995c6a2ac
commit
864a254071
4 changed files with 22 additions and 3 deletions
|
@ -291,3 +291,14 @@ async def test_refresh_token_not_requires_client_for_system_user(hass):
|
|||
token = await manager.async_create_refresh_token(user)
|
||||
assert token is not None
|
||||
assert token.client_id is None
|
||||
|
||||
|
||||
async def test_cannot_deactive_owner(mock_hass):
|
||||
"""Test that we cannot deactive the owner."""
|
||||
manager = await auth.auth_manager_from_config(mock_hass, [])
|
||||
owner = MockUser(
|
||||
is_owner=True,
|
||||
).add_to_auth_manager(manager)
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
await manager.async_deactivate_user(owner)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue