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

Make sure we can force a non-keyword key to act as a keyword key


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17716 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0bc89eb8
...@@ -2031,6 +2031,21 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -2031,6 +2031,21 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
ctool(portal_type='Organisation', title=dict(query='Foo%', ctool(portal_type='Organisation', title=dict(query='Foo%',
key='ExactMatch'))]) key='ExactMatch'))])
def test_KeywordSearch(self):
# test keyword search with queries
doc = self._makeOrganisation(description='Foo')
other_doc = self._makeOrganisation(description='Foobar')
ctool = self.getCatalogTool()
# description is not a keyword by default. (This might change in the
# future, in this case, this test have to be updated)
self.assertSameSet([doc], [x.getObject() for x in
ctool(portal_type='Organisation', description='Foo')])
self.assertEquals(set([doc, other_doc]), set([x.getObject() for x in
ctool(portal_type='Organisation', description=dict(query='Foo',
key='Keyword'))]))
def test_ignore_empty_string(self): def test_ignore_empty_string(self):
# ERP5Catalog ignore empty strings by default # ERP5Catalog ignore empty strings by default
doc_with_title = self._makeOrganisation(title='X') doc_with_title = self._makeOrganisation(title='X')
......
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