diff options
| 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 | 
| commit | 9ddc0da7db9b7603c0b71223ca161397088a9613 (patch) | |
| tree | d64cf19a3cf5869db8773e5b8805cc67ca51e390 /archaeological_operations/tests.py | |
| parent | 3920c6a34eaddee7397a93d08487194a5119e74f (diff) | |
| download | Ishtar-9ddc0da7db9b7603c0b71223ca161397088a9613.tar.bz2 Ishtar-9ddc0da7db9b7603c0b71223ca161397088a9613.zip | |
Facet search: manage term containing = or | inside quotes
Diffstat (limited to 'archaeological_operations/tests.py')
| -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() | 
