Revert "Revert "Add preselect_remember_me to /auth/providers"" (#106867)

This commit is contained in:
Robert Resch 2024-01-11 10:37:19 +01:00 committed by GitHub
parent b08832a89a
commit 1c669c6e84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 126 deletions

View file

@ -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"}