Revert "Revert "Add preselect_remember_me to /auth/providers
"" (#106867)
This commit is contained in:
parent
b08832a89a
commit
1c669c6e84
4 changed files with 57 additions and 126 deletions
|
@ -1,5 +1,4 @@
|
|||
"""The tests for the person component."""
|
||||
from http import HTTPStatus
|
||||
from typing import Any
|
||||
from unittest.mock import patch
|
||||
|
||||
|
@ -30,7 +29,7 @@ from homeassistant.setup import async_setup_component
|
|||
from .conftest import DEVICE_TRACKER, DEVICE_TRACKER_2
|
||||
|
||||
from tests.common import MockUser, mock_component, mock_restore_cache
|
||||
from tests.typing import ClientSessionGenerator, WebSocketGenerator
|
||||
from tests.typing import WebSocketGenerator
|
||||
|
||||
|
||||
async def test_minimal_setup(hass: HomeAssistant) -> None:
|
||||
|
@ -848,30 +847,3 @@ async def test_entities_in_person(hass: HomeAssistant) -> None:
|
|||
"device_tracker.paulus_iphone",
|
||||
"device_tracker.paulus_ipad",
|
||||
]
|
||||
|
||||
|
||||
async def test_list_persons(
|
||||
hass: HomeAssistant,
|
||||
hass_client_no_auth: ClientSessionGenerator,
|
||||
hass_admin_user: MockUser,
|
||||
) -> None:
|
||||
"""Test listing persons from a not local ip address."""
|
||||
|
||||
user_id = hass_admin_user.id
|
||||
admin = {"id": "1234", "name": "Admin", "user_id": user_id, "picture": "/bla"}
|
||||
config = {
|
||||
DOMAIN: [
|
||||
admin,
|
||||
{"id": "5678", "name": "Only a person"},
|
||||
]
|
||||
}
|
||||
assert await async_setup_component(hass, DOMAIN, config)
|
||||
|
||||
await async_setup_component(hass, "api", {})
|
||||
client = await hass_client_no_auth()
|
||||
|
||||
resp = await client.get("/api/person/list")
|
||||
|
||||
assert resp.status == HTTPStatus.BAD_REQUEST
|
||||
result = await resp.json()
|
||||
assert result == {"code": "not_local", "message": "Not local"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue