Commit 6ab98af3 authored by Julien Muchembled's avatar Julien Muchembled

Add unit test to show there is no difference between contentValues and objectValues about security.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26214 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0efbe3a3
...@@ -2609,6 +2609,26 @@ class TestPropertySheet: ...@@ -2609,6 +2609,26 @@ class TestPropertySheet:
person.setProperty('foo_bar_list', ['foo', 'bar']) person.setProperty('foo_bar_list', ['foo', 'bar'])
self.assertEquals(list(person.getProperty('foo_bar_list')), ['foo', 'bar']) self.assertEquals(list(person.getProperty('foo_bar_list')), ['foo', 'bar'])
def test_objectValues_contentValues(self):
"""
Test checked_permission parameter on Folder.objectValues and
Folder.contentValues.
Also test that there is no difference between objectValues and
contentValues about security.
"""
person = self.getPersonModule().newContent(portal_type='Person')
address = person.newContent(portal_type='Address')
def check(count):
for values in person.objectValues, person.contentValues:
self.assertEqual(1, len(values()))
self.assertEqual(count, len(values(checked_permission='View')))
check(1)
for permission in 'View', 'Access contents information':
address.manage_permission(permission, roles=(), acquire=0)
check(0)
class TestAccessControl(ERP5TypeTestCase): class TestAccessControl(ERP5TypeTestCase):
# Isolate test in a dedicaced class in order not to break other tests # Isolate test in a dedicaced class in order not to break other tests
# when this one fails. # when this one fails.
......
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