diff options
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r-- | archaeological_operations/tests.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index cfcbe010b..38f832cf8 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -50,6 +50,8 @@ from archaeological_context_records.models import Unit, ContextRecord from ishtar_common import forms_common from ishtar_common.tests import WizardTest, WizardTestFormData as FormData, \ create_superuser, create_user, TestCase, OPERATION_FIXTURES +from ishtar_common.utils import TXT_SEARCH_COMMENT + OPERATION_TOWNS_FIXTURES = \ OPERATION_FIXTURES + \ @@ -1568,6 +1570,7 @@ class OperationSearchTest(TestCase, OperationInitTest): c.login(username=self.username, password=self.password) ope1.year = 2042 + ope1.end_date = "2010-01-01" ope1.save() ope2.year = 2020 ope2.save() @@ -1589,22 +1592,15 @@ class OperationSearchTest(TestCase, OperationInitTest): villa = models.RemainType.objects.get(txt_idx='villa') ope1.remains.add(villa) - search_period_q = unicode( - pgettext("key for text search (no accent, no spaces)", u"period") - ) - + search_period_q = unicode(pgettext(TXT_SEARCH_COMMENT, u"period")) self._test_search(c, search_period_q, final_neo.label, 1, "Simple") - search_year_q = unicode( - pgettext("key for text search (no accent, no spaces)", u"year") - ) + search_year_q = unicode(pgettext(TXT_SEARCH_COMMENT, u"year")) self._test_search(c, search_year_q, "2042", 1, "Integer") self._test_search(c, search_year_q, '2042";"2020', 2, "Many integer") - search_town_q = unicode( - pgettext("key for text search (no accent, no spaces)", u"town") - ) + search_town_q = unicode(pgettext(TXT_SEARCH_COMMENT, u"town")) self._test_search(c, search_town_q, town.cached_label, 1, "String search with parenthesis and minus") @@ -1627,12 +1623,14 @@ class OperationSearchTest(TestCase, OperationInitTest): u'{}*'.format(neo.label[:3]), 2, "Open search") # non hierarchic search - search_remain_q = unicode( - pgettext("key for text search (no accent, no spaces)", u"remain") - ) + search_remain_q = unicode(pgettext(TXT_SEARCH_COMMENT, u"remain")) self._test_search(c, search_remain_q, villa.label, 1, "Non hierarchic search") + # boolean search + search_open_q = unicode(pgettext(TXT_SEARCH_COMMENT, u"is-open")) + self._test_search(c, search_open_q, u"Yes", 2, "Boolean") + def create_relations(self): rel1 = models.RelationType.objects.create( symmetrical=True, label='Include', txt_idx='include') |