Commit 51d10c04 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test: 2 roles are expected to be without group

parent d67d87f6
...@@ -50,11 +50,20 @@ class TestSlapOSGroupRoleSecurityCoverage(SlapOSTestCaseMixinWithAbort): ...@@ -50,11 +50,20 @@ class TestSlapOSGroupRoleSecurityCoverage(SlapOSTestCaseMixinWithAbort):
XXX how to check the consistency XXX how to check the consistency
""" """
test_list = [] test_list = []
expected_failure_dict = {
# comes from generic erp5 bt5. Unused
'Query - Acquired Assignee': None,
# Like 'user' group, but for instance
# there is no local_role_group for single instance user
'Slave Instance - Software Instance which provides this Slave Instance': None
}
for pt in self.portal.portal_types.objectValues(): for pt in self.portal.portal_types.objectValues():
for role_information in pt.contentValues(portal_type="Role Information"): for role_information in pt.contentValues(portal_type="Role Information"):
group = role_information.getLocalRoleGroupValue() group = role_information.getLocalRoleGroupValue()
if group is None: role_title = '%s - %s' % (pt.getId(), role_information.getTitle())
test_list.append('%s - %s' % (pt.getId(), role_information.getTitle())) if ((group is None) and (role_title not in expected_failure_dict)) or \
((group is not None) and (role_title in expected_failure_dict)):
test_list.append(role_title)
test_list.sort() test_list.sort()
self.assertEqual(test_list, []) self.assertEqual(test_list, [])
......
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