def create(cls, **props): user = cls() user.password = cls.hash_password(props.pop('password')) user.update(**props) user_role = Role.get_user_role() user.roles.append(user_role) user.save() return user
def test_get_user_role(self): role = Role.get_user_role() eq_(role.name, RoleNames.user)