Add Forecast.actual column
This commit is contained in:
parent
6429165aaf
commit
a5b590b24c
3 changed files with 58 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ def forecast(pixel):
|
|||
time_step=60,
|
||||
training_horizon=8,
|
||||
model='hets',
|
||||
actual=12,
|
||||
prediction=12.3,
|
||||
low80=1.23,
|
||||
high80=123.4,
|
||||
|
|
@ -131,6 +132,16 @@ class TestConstraints:
|
|||
):
|
||||
db_session.commit()
|
||||
|
||||
def test_non_negative_actuals(self, db_session, forecast):
|
||||
"""Insert an instance with invalid data."""
|
||||
forecast.actual = -1
|
||||
db_session.add(forecast)
|
||||
|
||||
with pytest.raises(
|
||||
sa_exc.IntegrityError, match='actuals_must_be_non_negative',
|
||||
):
|
||||
db_session.commit()
|
||||
|
||||
def test_set_prediction_without_ci(self, db_session, forecast):
|
||||
"""Sanity check to see that the check constraint ...
|
||||
|
||||
|
|
@ -388,6 +399,7 @@ class TestConstraints:
|
|||
time_step=forecast.time_step,
|
||||
training_horizon=forecast.training_horizon,
|
||||
model=forecast.model,
|
||||
actual=forecast.actual,
|
||||
prediction=2,
|
||||
low80=1,
|
||||
high80=3,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue