mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Load translations at setup time if they were not loaded at bootstrap (#110921)
This commit is contained in:
@@ -8,7 +8,7 @@ from unittest.mock import Mock, call, patch
|
||||
import pytest
|
||||
|
||||
from homeassistant import loader
|
||||
from homeassistant.const import EVENT_COMPONENT_LOADED, EVENT_CORE_CONFIG_UPDATE
|
||||
from homeassistant.const import EVENT_CORE_CONFIG_UPDATE
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import translation
|
||||
from homeassistant.loader import async_get_integration
|
||||
@@ -605,20 +605,6 @@ async def test_setup(hass: HomeAssistant):
|
||||
"""Test the setup load listeners helper."""
|
||||
translation.async_setup(hass)
|
||||
|
||||
with patch(
|
||||
"homeassistant.helpers.translation._TranslationCache.async_load",
|
||||
) as mock:
|
||||
hass.bus.async_fire(EVENT_COMPONENT_LOADED, {"component": "loaded_component"})
|
||||
await hass.async_block_till_done()
|
||||
mock.assert_called_once_with(hass.config.language, {"loaded_component"})
|
||||
|
||||
with patch(
|
||||
"homeassistant.helpers.translation._TranslationCache.async_load",
|
||||
) as mock:
|
||||
hass.bus.async_fire(EVENT_COMPONENT_LOADED, {"component": "config.component"})
|
||||
await hass.async_block_till_done()
|
||||
mock.assert_not_called()
|
||||
|
||||
# Should not be called if the language is the current language
|
||||
with patch(
|
||||
"homeassistant.helpers.translation._TranslationCache.async_load",
|
||||
|
||||
Reference in New Issue
Block a user