def testSaveAnotherUsersRole(self): setCurrentUser("*****@*****.**", "User1") register_new_user('User1') roleid = create_role("Test Role 1") save_role(roleid, "New Role name") logoutCurrentUser() setCurrentUser("*****@*****.**", "User2") self.assertRaises(DataModelException, save_role, roleid, "Should Fail") register_new_user('User2') self.assertRaises(DataModelException, save_role, roleid, "Should Fail")
def testSaveRoleName(self): setCurrentUser("*****@*****.**", "User1") register_new_user('User1') roleid = create_role("Test Role 1") save_role(roleid, "New Role name") self.assertEqual(get_my_roles()[0]["name"], "New Role name")