diff options
Diffstat (limited to 'archaeological_finds/tests.py')
| -rw-r--r-- | archaeological_finds/tests.py | 21 | 
1 files changed, 21 insertions, 0 deletions
| diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index d4a02b94d..b4612619b 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -1391,6 +1391,27 @@ class FindSearchTest(FindInit, TestCase, SearchText):          result = [('{}="{}"'.format(key, "Operation Common Name"), 1)]          self._test_search(c, result, context="Text Operation Common Name Search") +    def test_description_search(self): +        find = self.finds[0] +        find.description = "A simple description." +        find.save() +        find2 = self.finds[1] +        find2.description = "" +        find2.save() +        self.create_finds() +        self.create_finds() + +        c = Client() +        c.login(username=self.username, password=self.password) + +        key = str(pgettext_lazy("key for text search", "description")) +        result = [('{}="{}"'.format(key, "A simple description."), 1)] +        self._test_search(c, result, context="Text description Search") +        result = [('{}="{}"'.format(key, "*"), 1)] +        self._test_search(c, result, context="* description Search") +        result = [('-{}="{}"'.format(key, "*"), models.Find.objects.count() - 1)] +        self._test_search(c, result, context="-* description Search") +      def test_address_operation_search(self):          operation = self.operations[0]          operation.address = "Street somewhere 29478 NOWHERE" | 
