web/test/unittest_magicsearch.py
changeset 2637 07103211e511
parent 2058 7ef12c03447c
child 2643 9976f511003b
equal deleted inserted replaced
2636:104291d9bd00 2637:07103211e511
   145                           ('CWUser C WHERE C use_email C1, C1 has_text %(text)s', {'text': 'Logilab'}))
   145                           ('CWUser C WHERE C use_email C1, C1 has_text %(text)s', {'text': 'Logilab'}))
   146         self.assertEquals(transform('CWUser', 'use_email', '%Logilab'),
   146         self.assertEquals(transform('CWUser', 'use_email', '%Logilab'),
   147                           ('CWUser C WHERE C use_email C1, C1 alias LIKE %(text)s', {'text': '%Logilab'}))
   147                           ('CWUser C WHERE C use_email C1, C1 alias LIKE %(text)s', {'text': '%Logilab'}))
   148         self.assertRaises(BadRQLQuery, transform, 'word1', 'word2', 'word3')
   148         self.assertRaises(BadRQLQuery, transform, 'word1', 'word2', 'word3')
   149 
   149 
   150     def test_multiple_words_query(self):
       
   151         """tests multiple_words_query()"""
       
   152         self.assertEquals(self.proc._multiple_words_query(['a', 'b', 'c', 'd', 'e']),
       
   153                           ('a b c d e',))
       
   154 
       
   155     def test_quoted_queries(self):
   150     def test_quoted_queries(self):
   156         """tests how quoted queries are handled"""
   151         """tests how quoted queries are handled"""
   157         queries = [
   152         queries = [
   158             (u'Adresse "My own EmailAddress"', ('EmailAddress E WHERE E has_text %(text)s', {'text': u'My own EmailAddress'})),
   153             (u'Adresse "My own EmailAddress"', ('EmailAddress E WHERE E has_text %(text)s', {'text': u'My own EmailAddress'})),
   159             (u'Utilisateur prénom "Jean Paul"', ('CWUser C WHERE C firstname %(text)s', {'text': 'Jean Paul'})),
   154             (u'Utilisateur prénom "Jean Paul"', ('CWUser C WHERE C firstname %(text)s', {'text': 'Jean Paul'})),