예제 #1
0
 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")
예제 #2
0
 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")