Commit e84994bf authored by Jérome Perrin's avatar Jérome Perrin

More tests for keyword search keys with spaces, - and %



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19668 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 132a0535
...@@ -243,6 +243,30 @@ class TestQuery(unittest.TestCase): ...@@ -243,6 +243,30 @@ class TestQuery(unittest.TestCase):
datetime_search_keys = [], datetime_search_keys = [],
full_text_search_keys=[])) full_text_search_keys=[]))
def testQueryKeywordSearchKeyWithPercent(self):
q = Query(title='F%o')
self.assertEquals(dict(where_expression="((((title LIKE '%F%o%'))))",
select_expression_list=[]),
q.asSQLExpression(keyword_search_keys=['title'],
datetime_search_keys = [],
full_text_search_keys=[]))
def testQueryKeywordSearchKeyWithMinus(self):
q = Query(title='F-o')
self.assertEquals(dict(where_expression="((((title LIKE '%F-o%'))))",
select_expression_list=[]),
q.asSQLExpression(keyword_search_keys=['title'],
datetime_search_keys = [],
full_text_search_keys=[]))
def testQueryKeywordSearchKeyWithSpace(self):
q = Query(title='F o')
self.assertEquals(dict(where_expression="((((title LIKE '%F o%'))))",
select_expression_list=[]),
q.asSQLExpression(keyword_search_keys=['title'],
datetime_search_keys = [],
full_text_search_keys=[]))
def testNegatedQuery(self): def testNegatedQuery(self):
q1 = Query(title='Foo') q1 = Query(title='Foo')
q = NegatedQuery(q1) q = NegatedQuery(q1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment