From bf2f51538bac27ee9716e3acd3383c8ee535d33f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 9 Jan 2023 17:37:19 +0100 Subject: Fix strange bug on statistics with criteria --- archaeological_operations/tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'archaeological_operations/tests.py') diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 25a561b6f..b9c119826 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -3265,6 +3265,15 @@ class OperationSearchTest(TestCase, OperationInitTest, SearchText): values = json.loads(response.content.decode()) self.assertEqual(values["data"], expected_result) + # with criteria + q = {"stats_modality_1": "year", "stats_modality_2": "operation_type__label", + "search_vector": 'patriarche=1'} + response = c.get(reverse("get-operation", args=["json-stats"]), q) + self.assertEqual(response.status_code, 200) + values = json.loads(response.content.decode()) + expected_result = [[2010, [['Diagnostic archéologique', 1]]]] + self.assertEqual(values["data"], expected_result) + class OperationPermissionTest(TestCase, OperationInitTest): fixtures = FILE_FIXTURES -- cgit v1.2.3