diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-10-13 05:22:06 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:20:59 +0100 |
commit | ba24111f03c601458f2ede5447c57fc7b22e6246 (patch) | |
tree | f3458c69995278f9c5b69c0b3ef5208221ab57ff /archaeological_operations/tests.py | |
parent | 3962e32e1d1d7517b3c625df5f85770285014091 (diff) | |
download | Ishtar-ba24111f03c601458f2ede5447c57fc7b22e6246.tar.bz2 Ishtar-ba24111f03c601458f2ede5447c57fc7b22e6246.zip |
Syndication: query string limitation for external source
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r-- | archaeological_operations/tests.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index ae012840f..cd1f6ac6d 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -4500,7 +4500,7 @@ class ApiTest(OperationInitTest, APITestCase): self.api_user.save() def test_api_search(self): - self.create_api_search_model() + api_search_model = self.create_api_search_model() url = reverse("api-search-operation") data = { "submited": 1, @@ -4514,6 +4514,17 @@ class ApiTest(OperationInitTest, APITestCase): j = json.loads(response.content.decode()) self.assertEqual(j['recordsTotal'], 2) # test default filter + search_code_q = str(pgettext("key for text search", "patriarche")) + api_search_model.limit_query = '{}="28124"'.format(search_code_q) + api_search_model.save() + response = self.client.get( + url, format="json", HTTP_AUTHORIZATION=self.auth_token, + data=data + ) + self.assertEqual(response.status_code, 200) + j = json.loads(response.content.decode()) + self.assertEqual(j['recordsTotal'], 1, "api search limitation not effective") + def test_query_transformation(self): # change query terms from a source Ishtar to match distant Ishtar |