diff options
Diffstat (limited to 'archaeological_operations/tests.py')
| -rw-r--r-- | archaeological_operations/tests.py | 21 | 
1 files changed, 21 insertions, 0 deletions
| diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index f67ce5adc..4a27660d0 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -1542,6 +1542,12 @@ class OperationSearchTest(TestCase, OperationInitTest):          result = json.loads(response.content)          self.assertEqual(result['recordsTotal'], 3) +        # exclude +        response = c.get(reverse('get-operation'), +                         {'search_vector': '-fougere'}) +        result = json.loads(response.content) +        self.assertEqual(result['recordsTotal'], 1) +      def test_facet_search_vector(self):          ope1 = self.operations[0]          ope2 = self.operations[1] @@ -1577,6 +1583,13 @@ class OperationSearchTest(TestCase, OperationInitTest):          result = json.loads(response.content)          self.assertEqual(result['recordsTotal'], 2) +        # exclude +        search = {'search_vector': u'-{}="{}"'.format(search_q, neo.label)} +        response = c.get(reverse('get-operation'), search) +        self.assertEqual(response.status_code, 200) +        result = json.loads(response.content) +        self.assertEqual(result['recordsTotal'], 1) +          # OR          search = {'search_vector': u'{}="{}";"{}"'.format(search_q, neo.label,                                                            gallo.label)} @@ -1585,6 +1598,14 @@ class OperationSearchTest(TestCase, OperationInitTest):          result = json.loads(response.content)          self.assertEqual(result['recordsTotal'], 3) +        # OR - alt syntax +        search = {'search_vector': u'{}="{}" {}="{}"'.format( +            search_q, neo.label, search_q, gallo.label)} +        response = c.get(reverse('get-operation'), search) +        self.assertEqual(response.status_code, 200) +        result = json.loads(response.content) +        self.assertEqual(result['recordsTotal'], 3) +          # open search '*'          search = {'search_vector': u'{}="{}*"'.format(search_q, neo.label[:3])}          response = c.get(reverse('get-operation'), search) | 
