[Erp5-report] r14066 - in /erp5/trunk/products: ERP5Catalog/tests/ ZSQLCatalog/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Apr 12 18:01:44 CEST 2007


Author: vincent
Date: Thu Apr 12 18:01:43 2007
New Revision: 14066

URL: http://svn.erp5.org?rev=14066&view=rev
Log:
Fix and add a test for the case where the date is an empty string - and therefore should be ignored in the final query.

Modified:
    erp5/trunk/products/ERP5Catalog/tests/testERP5Catalog.py
    erp5/trunk/products/ZSQLCatalog/SQLCatalog.py

Modified: erp5/trunk/products/ERP5Catalog/tests/testERP5Catalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Catalog/tests/testERP5Catalog.py?rev=14066&r1=14065&r2=14066&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Catalog/tests/testERP5Catalog.py (original)
+++ erp5/trunk/products/ERP5Catalog/tests/testERP5Catalog.py Thu Apr 12 18:01:43 2007
@@ -1746,7 +1746,13 @@
     self.failIfDifferentSet([org_a.getPath()],
         [x.path for x in self.getCatalogTool()(
                 portal_type='Organisation',**catalog_kw)])
-
+    # If the date is an empty string, check that all objects are displayed.
+    catalog_kw = {'modification_date':{'query':'',
+                               'format':'%d/%m/%Y',
+                               'type':'date'}}
+    self.failIfDifferentSet([org_a.getPath(), org_b.getPath()],
+        [x.path for x in self.getCatalogTool()(
+                portal_type='Organisation',**catalog_kw)])
 
 if __name__ == '__main__':
     framework()

Modified: erp5/trunk/products/ZSQLCatalog/SQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SQLCatalog.py?rev=14066&r1=14065&r2=14066&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/SQLCatalog.py (original)
+++ erp5/trunk/products/ZSQLCatalog/SQLCatalog.py Thu Apr 12 18:01:43 2007
@@ -377,7 +377,7 @@
                      (key, value, mode,key.split('.')[1]))
           else:
             comparison_operator = '='
-        else:
+        elif not isinstance(value, basestring):
           comparison_operator = '='
         if comparison_operator is not None:
           key = self._quoteSQLKey(key)




More information about the Erp5-report mailing list