def change_admin_role(self, is_admin): admin_role = Role.get_admin_role() if is_admin: self.roles.append(admin_role) else: if self.is_admin: self.roles.remove(admin_role)
def test_get_admin_role(self): role = Role.get_admin_role() eq_(role.name, RoleNames.admin)