Commit f0e17e5b authored by Vincent Pelletier's avatar Vincent Pelletier

Fix and add a test for the case where the date is an empty string - and...

Fix and add a test for the case where the date is an empty string - and therefore should be ignored in the final query.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14066 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a85a1a88
...@@ -1746,7 +1746,13 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1746,7 +1746,13 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self.failIfDifferentSet([org_a.getPath()], self.failIfDifferentSet([org_a.getPath()],
[x.path for x in self.getCatalogTool()( [x.path for x in self.getCatalogTool()(
portal_type='Organisation',**catalog_kw)]) 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__': if __name__ == '__main__':
framework() framework()
......
...@@ -377,7 +377,7 @@ class Query(QueryMixin): ...@@ -377,7 +377,7 @@ class Query(QueryMixin):
(key, value, mode,key.split('.')[1])) (key, value, mode,key.split('.')[1]))
else: else:
comparison_operator = '=' comparison_operator = '='
else: elif not isinstance(value, basestring):
comparison_operator = '=' comparison_operator = '='
if comparison_operator is not None: if comparison_operator is not None:
key = self._quoteSQLKey(key) key = self._quoteSQLKey(key)
......
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