diff --git a/src/tests/test_gsp.py b/src/tests/test_gsp.py index 57f38f7..6ecee66 100644 --- a/src/tests/test_gsp.py +++ b/src/tests/test_gsp.py @@ -39,6 +39,25 @@ def test_read_latest_one_gsp(db_session, api_client): _ = [ForecastValue(**f) for f in response.json()] + +@freeze_time("2022-01-01") +def test_read_latest_one_gsp_national(db_session, api_client): + """Check main solar/GB/gsp/{gsp_id}/forecast route works""" + + forecasts = make_fake_forecasts( + gsp_ids=list(range(0, 2)), session=db_session, add_latest=True, model_name="blend" + ) + db_session.add_all(forecasts) + db_session.commit() + + app.dependency_overrides[get_session] = lambda: db_session + + response = api_client.get("/v0/solar/GB/gsp/0/forecast") + + assert response.status_code == 200 + + _ = [ForecastValue(**f) for f in response.json()] + def test_read_latest_one_gsp_filter_creation_utc(db_session, api_client): """Check main solar/GB/gsp/{gsp_id}/forecast route works"""