Example #1
0
    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
Example #2
0
 def test_get_user_role(self):
     role = Role.get_user_role()
     eq_(role.name, RoleNames.user)