1
mirror of https://github.com/home-assistant/core synced 2024-09-12 15:16:21 +02:00

Use a fully mocked credential (#45707)

This commit is contained in:
Joakim Plate 2021-01-29 17:58:25 +01:00 committed by GitHub
parent bcc9add0b4
commit af68d5fb41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,9 +204,13 @@ def mock_device_tracker_conf():
@pytest.fixture
async def hass_admin_credential(hass, local_auth):
"""Provide credentials for admin user."""
await hass.async_add_executor_job(local_auth.data.add_auth, "admin", "admin-pass")
return await local_auth.async_get_or_create_credentials({"username": "admin"})
return Credentials(
id="mock-credential-id",
auth_provider_type="homeassistant",
auth_provider_id=None,
data={"username": "admin"},
is_new=False,
)
@pytest.fixture