[Erp5-report] r20949 - /erp5/trunk/products/ZSQLCatalog/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed May 14 10:31:50 CEST 2008


Author: jerome
Date: Wed May 14 10:31:50 2008
New Revision: 20949

URL: http://svn.erp5.org?rev=20949&view=rev
Log:
Add a few more tests for full text keys.

Modified:
    erp5/trunk/products/ZSQLCatalog/tests/testSearchKeys.py
    erp5/trunk/products/ZSQLCatalog/tests/testZSQLCatalog.py

Modified: erp5/trunk/products/ZSQLCatalog/tests/testSearchKeys.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/tests/testSearchKeys.py?rev=20949&r1=20948&r2=20949&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/tests/testSearchKeys.py (original)
+++ erp5/trunk/products/ZSQLCatalog/tests/testSearchKeys.py Wed May 14 10:31:50 2008
@@ -121,12 +121,14 @@
   def test_05FullTextKey(self, quiet=quiet, run=run_all_test):
     """ Check lexer for FullTextKey."""
     if not run: return
+    self.compare(FullTextKey, 'John', ('WORD',))
     self.compare(FullTextKey, 'John Doe', ('WORD', 'WORD',))
     self.compare(FullTextKey, '+John -Doe',
                  ('PLUS', 'WORD', 'MINUS', 'WORD',))
+    self.compare(FullTextKey, 'John*', ('WORD', 'ASTERISK'))
+    self.compare(FullTextKey, '+John*', ('PLUS', 'WORD', 'ASTERISK'))
     self.compare(FullTextKey, '.', ('WORD',))
     self.compare(FullTextKey, '"John Doe"', ('DOUBLEQUOTE', 'WORD', 'WORD', 'DOUBLEQUOTE'))
-    self.compare(FullTextKey, 'John*', ('WORD', 'ASTERISK'))
     self.compare(FullTextKey, '+apple +(>turnover <strudel)',
                  ('PLUS', 'WORD', 'PLUS', 'LEFTPARENTHES', 'GREATERTHAN', 'WORD',
                   'LESSTHAN', 'WORD', 'RIGHTPARENTHES',))

Modified: erp5/trunk/products/ZSQLCatalog/tests/testZSQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/tests/testZSQLCatalog.py?rev=20949&r1=20948&r2=20949&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/tests/testZSQLCatalog.py (original)
+++ erp5/trunk/products/ZSQLCatalog/tests/testZSQLCatalog.py Wed May 14 10:31:50 2008
@@ -223,6 +223,14 @@
                             datetime_search_keys = [],
                             full_text_search_keys=['title']))
   
+  def testSimpleQueryFullAutomaticTextSearchMode(self):
+    q = Query(title='Foo*',)
+    self.assertEquals(dict(
+      where_expression="MATCH title AGAINST ('Foo*' IN BOOLEAN MODE)",
+      select_expression_list=
+        ["MATCH title AGAINST ('Foo*' IN BOOLEAN MODE) AS title_relevance"]),
+          q.asSQLExpression(full_text_search_keys=['title']))
+
   def testSimpleQueryFullTextStat__(self):
     # stat__ is an internal implementation artifact to prevent adding
     # select_expression for countFolder




More information about the Erp5-report mailing list