Skip to content

Commit e74869e

Browse files
committed
updated test seed random
1 parent 3243354 commit e74869e

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

tests/system/test_seed_random.py

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from urllib.parse import quote
2+
13
import pytest
24
from django.core.management import call_command
35
from rest_framework.test import APIClient
@@ -46,22 +48,17 @@ def test_command_seeds_metrics_dataset_and_data_is_queryable_via_api(self):
4648
assert sample_row is not None
4749

4850
api_client = APIClient()
49-
response = api_client.post(
50-
path="/api/tables/v4/",
51-
data={
52-
"file_format": "svg",
53-
"plots": [
54-
{
55-
"topic": sample_row.topic,
56-
"metric": sample_row.metric,
57-
"date_from": "2020-01-01",
58-
"chart_type": "bar",
59-
}
60-
],
61-
},
62-
format="json",
51+
path = (
52+
"/api/public/timeseries/"
53+
f"themes/{quote(sample_row.theme, safe='')}/"
54+
f"sub_themes/{quote(sample_row.sub_theme, safe='')}/"
55+
f"topics/{quote(sample_row.topic, safe='')}/"
56+
f"geography_types/{quote(sample_row.geography_type, safe='')}/"
57+
f"geographies/{quote(sample_row.geography, safe='')}/"
58+
"metrics/"
6359
)
60+
response = api_client.get(path=path, format="json")
6461

6562
assert response.status_code == HTTP_OK
66-
assert len(response.data) > 0
67-
assert len(response.data[0]["values"]) > 0
63+
assert "metrics" in response.data
64+
assert sample_row.metric in response.data["metrics"]

0 commit comments

Comments
 (0)