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

tests that portal_catalog supports query passed as dict in the REQUEST, in this

case it is not a dict, but a ZPublisher.HTTPRequest.record instance (which
behaves like a dict)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24005 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 426e2729
......@@ -1151,6 +1151,24 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_type='Organisation',
title={'query': ('B', 'C'), 'range': 'minngt'})])
def test_QueryDictFromRequest(self):
"""use a dict from REQUEST as a keyword parameter.
"""
org_a = self._makeOrganisation(title='A')
org_b = self._makeOrganisation(title='B')
org_c = self._makeOrganisation(title='C')
query_dict = {'query': ('B', 'C'), 'range': 'minngt'}
from ZPublisher.HTTPRequest import record
query_record = record()
for k, v in query_dict.items():
setattr(query_record, k, v)
self.assertEquals(set([org_b.getPath(), org_c.getPath()]),
set([x.path for x in self.getCatalogTool()(
portal_type='Organisation',
title=query_record)]))
def test_39_DeferredConnection(self, quiet=quiet, run=run_all_test):
"""ERP5Catalog uses a deferred connection for full text indexing.
"""
......
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