def test_other_user_role(self): user_to_update = User(password='******', id='uid2') user_doing_update = User(password='******', id='uid') result = yield user_to_update.can_update(user_doing_update, first_name='TestName') assert result == (False, set([]))
def test_current_user_role(self): user = User(password='******', id='uid') result = yield user.can_update(user, first_name='TestName', role='administrator') assert result == (False, {'role'})
def test_sys_admin(self): user_to_update = User(password='******', id='uid2') user_doing_update = User(password='******', role='administrator', id='uid') result = yield user_to_update.can_update(user_doing_update, first_name='TestName') assert result == (True, set([]))
def test_current_user(self): user = User(password='******', id='uid') result = yield user.can_update(user, first_name='TestName') assert result == (True, set([]))
def test_sys_admin_role(self): user_to_update = User(password='******', id='uid2') user_doing_update = User(password='******', role='administrator', id='uid') result = yield user_to_update.can_update(user_doing_update, first_name='TestName', role='administrator') assert result == (True, set([]))