Skip to content

Commit

Permalink
Test data_from_year field
Browse files Browse the repository at this point in the history
  • Loading branch information
juuso-j committed Sep 13, 2023
1 parent 5da1524 commit 7cbc2b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions eco_counter/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
from rest_framework.reverse import reverse

from .conftest import TEST_TIMESTAMP
from .constants import TEST_EC_STATION_NAME


Expand Down Expand Up @@ -271,6 +272,7 @@ def test__station(api_client, stations, year_datas):
assert response.status_code == 200
assert response.json()["results"][0]["name"] == TEST_EC_STATION_NAME
assert response.json()["results"][0]["sensor_types"] == ["at"]
assert response.json()["results"][0]["data_from_year"] == TEST_TIMESTAMP.year
# Test retrieving station by data type
url = reverse("eco_counter:stations-list") + "?data_type=a"
response = api_client.get(url)
Expand Down

0 comments on commit 7cbc2b4

Please sign in to comment.