def test_create_user():
    user = make_user()
    user.password = '******'

    db_user = save_user(user)

    assert isinstance(db_user, User)
    assert isinstance(db_user.id, int)
    assert user.username == db_user.username
    assert user.password == db_user.password
    assert user.active == db_user.active
    assert user.created_at == db_user.created_at
def test_admin_user(session):
    user = make_user(uuid4().hex, DEFAULT_LOGIN_PASS, is_admin=True)
    return db_save(session, user)
def test_user(session):
    user = make_user(uuid4().hex, DEFAULT_LOGIN_PASS)
    return db_save(session, user)
 def _generate_user():
     user = make_user()
     return db_save(session, user)
 def _generate_user(is_admin=False):
     user = make_user(is_admin=is_admin)
     return db_save(session, user)
 def _generate_user(username, password, is_admin=False):
     user = make_user(username=username,
                      password=password,
                      is_admin=is_admin)
     return db_save(session, user)