From 5b25c9aea7f20e69172dd8455375dbfc4e5677ae Mon Sep 17 00:00:00 2001 From: Colin Goutte Date: Mon, 27 Sep 2021 15:24:38 +0200 Subject: [PATCH] Check measures registration --- tests/test_papi.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/test_papi.py b/tests/test_papi.py index 36263f6..e378b23 100644 --- a/tests/test_papi.py +++ b/tests/test_papi.py @@ -39,7 +39,14 @@ def test_lister_sondes(): def test_post_data(): id_ = "masonde_001" - data = {"example": "truc"} + from papi.main import mesures + + curlen = len(mesures) + + data = testutils.probe_sample_body() + + response = client.post(f"/sonde/{id_}/", json=data) + assert response.status_code == 200 + assert response.json()["count"] == curlen + 1 + - response = client.post(f"/sonde/{id_}") - assert response.ok