Skip to content

Commit

Permalink
Test data_until_date and data_from_date fields
Browse files Browse the repository at this point in the history
  • Loading branch information
juuso-j committed Oct 11, 2023
1 parent 8a922b5 commit 4f4d044
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eco_counter/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pytest
from rest_framework.reverse import reverse

from .conftest import TEST_TIMESTAMP
from .constants import TEST_EC_STATION_NAME


Expand Down Expand Up @@ -301,13 +300,14 @@ def test_months_multiple_years(api_client, years, test_timestamp):


@pytest.mark.django_db
def test_station(api_client, stations, year_datas):
def test_station(api_client, stations, year_datas, day_datas):
url = reverse("eco_counter:stations-list")
response = api_client.get(url)
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
assert response.json()["results"][0]["data_until_date"] == "2020-01-07"
assert response.json()["results"][0]["data_from_date"] == "2020-01-01"
# 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 4f4d044

Please sign in to comment.