From e84994bfbe4ab4b56c232af5c07aefda807e8478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Tue, 4 Mar 2008 15:33:05 +0000 Subject: [PATCH] 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 --- product/ZSQLCatalog/tests/testZSQLCatalog.py | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/product/ZSQLCatalog/tests/testZSQLCatalog.py b/product/ZSQLCatalog/tests/testZSQLCatalog.py index a63e0de647..93d1b7773e 100644 --- a/product/ZSQLCatalog/tests/testZSQLCatalog.py +++ b/product/ZSQLCatalog/tests/testZSQLCatalog.py @@ -243,6 +243,30 @@ class TestQuery(unittest.TestCase): datetime_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): q1 = Query(title='Foo') q = NegatedQuery(q1) -- 2.30.9