From af68d5fb412d753d87dbee1b641953d5ef30d851 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Fri, 29 Jan 2021 17:58:25 +0100 Subject: [PATCH] Use a fully mocked credential (#45707) --- tests/conftest.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 27559e9659d..f6ef33e8f25 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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