Exemplo n.º 1
0
def test_create_user(db_session, oauth_client):
    adm.create_user(db_session, "insert_user", "admin", "*****@*****.**")
    user = db_session.query(User).filter(
        User.username == "insert_user").first()
    assert user.username == "insert_user"
    assert user.is_admin == True
    assert user.email == "*****@*****.**"
Exemplo n.º 2
0
def create_user():
    """
    Create a user on the userdatamodel database

    Returns a json object
    """
    username = request.get_json().get("name", None)
    role = request.get_json().get("role", None)
    email = request.get_json().get("email", None)
    return jsonify(admin.create_user(current_session, username, role, email))
Exemplo n.º 3
0
def test_create_already_existing_user(db_session, awg_users):
    with pytest.raises(UserError):
        adm.create_user(db_session, "awg_user", "admin",
                        "*****@*****.**")