def test_role_settings(self): """TEST_USER_ID should be Contributor""" portal = self.layer['portal'] view = SharingView(portal.folder1, portal.folder1.REQUEST) for entry in view.role_settings(): if entry['id'] == TEST_USER_ID: break self.assertTrue(entry['roles']['Contributor'])
def test_has_local_role(self): portal = self.layer['portal'] view = SharingView(portal.folder1, portal.folder1.REQUEST) # As TEST_USER_ID self.assertTrue(view.has_local_role()) logout() login(portal, TEST_USER_ID_2) # As TEST_USER_ID_2 self.assertFalse(view.has_local_role()) logout() login(portal, TEST_USER_NAME)
def test_has_manager_role(self): """TEST_USER_ID has manager role from testsetup""" portal = self.layer['portal'] view = SharingView(portal.folder1, portal.folder1.REQUEST) self.assertTrue(view.has_manage_portal())