web/test/unittest_magicsearch.py
changeset 2058 7ef12c03447c
parent 1977 606923dff11b
child 2637 07103211e511
equal deleted inserted replaced
2057:0a0cbccafcb5 2058:7ef12c03447c
    42 
    42 
    43     def setUp(self):
    43     def setUp(self):
    44         super(QueryTranslatorTC, self).setUp()
    44         super(QueryTranslatorTC, self).setUp()
    45         self.req = self.env.create_request()
    45         self.req = self.env.create_request()
    46         self.vreg.config.translations = {'en': _translate}
    46         self.vreg.config.translations = {'en': _translate}
    47         proc = self.vreg.select_component('magicsearch', self.req)
    47         proc = self.vreg.select('components', 'magicsearch', self.req)
    48         self.proc = [p for p in proc.processors if isinstance(p, QueryTranslator)][0]
    48         self.proc = [p for p in proc.processors if isinstance(p, QueryTranslator)][0]
    49 
    49 
    50     def test_basic_translations(self):
    50     def test_basic_translations(self):
    51         """tests basic translations (no ambiguities)"""
    51         """tests basic translations (no ambiguities)"""
    52         rql = "Any C WHERE C is Adresse, P adel C, C adresse 'Logilab'"
    52         rql = "Any C WHERE C is Adresse, P adel C, C adresse 'Logilab'"
    67     """test suite for QSPreProcessor"""
    67     """test suite for QSPreProcessor"""
    68     def setUp(self):
    68     def setUp(self):
    69         super(QSPreProcessorTC, self).setUp()
    69         super(QSPreProcessorTC, self).setUp()
    70         self.vreg.config.translations = {'en': _translate}
    70         self.vreg.config.translations = {'en': _translate}
    71         self.req = self.request()
    71         self.req = self.request()
    72         proc = self.vreg.select_component('magicsearch', self.req)
    72         proc = self.vreg.select('components', 'magicsearch', self.req)
    73         self.proc = [p for p in proc.processors if isinstance(p, QSPreProcessor)][0]
    73         self.proc = [p for p in proc.processors if isinstance(p, QSPreProcessor)][0]
    74         self.proc.req = self.req
    74         self.proc.req = self.req
    75 
    75 
    76     def test_entity_translation(self):
    76     def test_entity_translation(self):
    77         """tests QSPreProcessor._get_entity_name()"""
    77         """tests QSPreProcessor._get_entity_name()"""
   189 
   189 
   190     def setUp(self):
   190     def setUp(self):
   191         super(ProcessorChainTC, self).setUp()
   191         super(ProcessorChainTC, self).setUp()
   192         self.vreg.config.translations = {'en': _translate}
   192         self.vreg.config.translations = {'en': _translate}
   193         self.req = self.request()
   193         self.req = self.request()
   194         self.proc = self.vreg.select_component('magicsearch', self.req)
   194         self.proc = self.vreg.select('components', 'magicsearch', self.req)
   195 
   195 
   196     def test_main_preprocessor_chain(self):
   196     def test_main_preprocessor_chain(self):
   197         """tests QUERY_PROCESSOR"""
   197         """tests QUERY_PROCESSOR"""
   198         queries = [
   198         queries = [
   199             (u'foo',
   199             (u'foo',