diff options
Diffstat (limited to 'archaeological_operations')
-rw-r--r-- | archaeological_operations/tests.py | 13 |
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() |