Commit ba665c55 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: check that Role Definition contains a local_role_group

parent f5c44432
......@@ -36,12 +36,26 @@ class TestSlapOSGroupRoleSecurityCoverage(SlapOSTestCaseMixinWithAbort):
test_list = []
for pt in self.portal.portal_types.objectValues():
if len(pt.contentValues(portal_type="Role Information")) > 0:
if 0 < len(pt.contentValues(portal_type="Role Information")):
test_klass = "class Test%s(" % "".join(pt.getId().split(" "))
if test_klass not in test_source_code:
test_list.append(pt.getId())
test_list.sort()
self.assertEqual(test_list, [])
def testLocalRoleGroup(self):
"""
Check that all role definitions use a local role group
XXX how to check the consistency
"""
test_list = []
for pt in self.portal.portal_types.objectValues():
for role_information in pt.contentValues(portal_type="Role Information"):
group = role_information.getLocalRoleGroupValue()
if group is None:
test_list.append('%s - %s' % (pt.getId(), role_information.getTitle()))
test_list.sort()
self.assertEqual(test_list, [])
class TestSlapOSGroupRoleSecurityMixin(SlapOSTestCaseMixinWithAbort):
......
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