def expect_user_is_in_role(self, user, rolename):
    self.security_manager.init_role(rolename, [])
    role = self.security_manager.find_role(rolename)
    if (not role):
        self.security_manager.add_role(rolename)
        role = self.security_manager.find_role(rolename)
    user.roles = [role]
    self.security_manager.update_user(user)
def expect_user_is_in_role(self, user, rolename):
    self.security_manager.init_role(rolename, [])
    role = self.security_manager.find_role(rolename)
    if (not role):
        self.security_manager.add_role(rolename)
        role = self.security_manager.find_role(rolename)
    user.roles = [role]
    self.security_manager.update_user(user)