summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-03-21 12:32:06 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-04-24 19:41:37 +0200
commit97ca6b195c509635a71a1bd1d15c0f24592e714d (patch)
treed64cf19a3cf5869db8773e5b8805cc67ca51e390 /archaeological_operations/tests.py
parent426e963e1504fd6d80c0f34af31dfbeb95ec2ae3 (diff)
downloadIshtar-97ca6b195c509635a71a1bd1d15c0f24592e714d.tar.bz2
Ishtar-97ca6b195c509635a71a1bd1d15c0f24592e714d.zip
Facet search: manage term containing = or | inside quotes
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index b983ff6de..6781cf531 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -1670,6 +1670,8 @@ class OperationSearchTest(TestCase, OperationInitTest):
response = c.get(reverse('get-operation'), search)
self.assertEqual(response.status_code, 200)
result = json.loads(response.content)
+ if not result:
+ result = {"recordsTotal": 0}
self.assertEqual(result['recordsTotal'], number,
u"{} - {} - {} result(s) expected got {}".format(
name, q, number, result['recordsTotal']))
@@ -1785,6 +1787,17 @@ class OperationSearchTest(TestCase, OperationInitTest):
response = c.get(reverse('get-operation'), search)
self.assertEqual(json.loads(response.content)['recordsTotal'], 2)
+ def test_search_with_problematic_characters(self):
+ c = Client()
+ c.login(username=self.username, password=self.password)
+ ope = self.operations[0]
+ lbl = "aha = take on me | take me on"
+ ope.common_name = lbl
+ ope.save()
+ search_name_q = str(pgettext("key for text search", u"name"))
+ self._test_search(c, search_name_q, lbl, 1,
+ "Facet search with = and | characters")
+
def test_hierarchic_search(self):
ope = self.operations[1]
c = Client()