summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-09 17:37:19 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-09 17:37:19 +0100
commit0e2280daec5f3e82c7a3b6d219c0485fc4097e16 (patch)
tree49b6133816178c99b45915b34ec5a73d7b6a5c28 /archaeological_operations/tests.py
parent81bcc5deb221afada7b303d386761817ba4a4e55 (diff)
downloadIshtar-0e2280daec5f3e82c7a3b6d219c0485fc4097e16.tar.bz2
Ishtar-0e2280daec5f3e82c7a3b6d219c0485fc4097e16.zip
Fix strange bug on statistics with criteria
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index e7cbe670c..87a1fd7c9 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -3007,6 +3007,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