Commit ddf03406 authored by Vincent Pelletier's avatar Vincent Pelletier

Add a test checking that catalog does not collapse consecutive spaces.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29529 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0f884ea1
......@@ -3876,6 +3876,28 @@ VALUES
person_module.searchFolder(title=title)]
self.assertEquals([person_id],folder_object_list)
def test_SearchFolderWithMultipleSpaces(self, quiet=quiet):
if not quiet:
message = 'Search Folder With Multiple Spaces'
ZopeTestCase._print('\n%s ' % message)
LOG('Testing... ',0,message)
person_module = self.getPersonModule()
# Make sure that the catalog will not split it with such research :
# title=foo AND title=bar
title='foo bar'
person_module.newContent(portal_type='Person',title=title).immediateReindexObject()
title = title.replace(' ', ' ')
person = person_module.newContent(portal_type='Person',title=title)
person_id = person.getId()
person.immediateReindexObject()
folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
self.assertTrue(person_id in folder_object_list)
folder_object_list = [x.getObject().getId() for x in
person_module.searchFolder(title=title)]
self.assertEquals([person_id],folder_object_list)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Catalog))
......
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