Commit 46040364 authored by Sebastien Robin's avatar Sebastien Robin

add new test in order to check the select_dict parameter

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30023 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 406e7be8
......@@ -3905,6 +3905,29 @@ VALUES
person_module.searchFolder(title=title)]
self.assertEquals([person_id],folder_object_list)
def test_ParameterSelectDict(self, quiet=quiet):
if not quiet:
message = 'Check Parameter Select Dict'
ZopeTestCase._print('\n%s ' % message)
LOG('Testing... ',0,message)
person_module = self.getPersonModule()
# Make sure that we are able to retrieve data directly from mysql
# without retrieving real objects
title="foo"
person = person_module.newContent(portal_type='Person',title=title)
person_uid = person.getUid()
person.immediateReindexObject()
folder_object_list = person_module.searchFolder(uid=person_uid, select_dict={'title': None})
new_title = 'bar'
person.setTitle(new_title)
self.assertEquals(new_title, person.getTitle())
expected_sql_title_list = [title]
self.assertEquals([x.title for x in folder_object_list], expected_sql_title_list)
real_title_list = [new_title]
self.assertEquals([x.getTitle() for x in folder_object_list], real_title_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