Avoid dataclass incompat with mock spec (#53298)

This commit is contained in:
Paulus Schoutsen
2021-07-21 17:12:14 -07:00
committed by GitHub
parent ecf0d4398d
commit 596179d180

View File

@@ -58,7 +58,7 @@ def mock_forecast_solar() -> Generator[None, MagicMock, None]:
forecast_solar = forecast_solar_mock.return_value
now = datetime(2021, 6, 27, 6, 0, tzinfo=dt_util.DEFAULT_TIME_ZONE)
estimate = MagicMock(spec_set=models.Estimate)
estimate = MagicMock(spec=models.Estimate)
estimate.now.return_value = now
estimate.timezone = "Europe/Amsterdam"
estimate.energy_production_today = 100000