def METHOD_NAME(flask_client, mfa: bool):
    email = random_email()
    User.create(
        email=email,
        password=PASSWORD_1,
        name="Test User",
        activated=True,
        enable_otp=mfa,
    )
    Session.commit()
    r = flask_client.post(
        "/api/auth/login",
        json={
            "email": email,
            "password": PASSWORD_2,
            "device": "Test Device",
        },
    )
    assert r.status_code == 200
    assert r.json["name"] == "Test User"
    assert r.json["email"]
    if mfa:
        assert r.json["api_key"] is None
        assert r.json["mfa_enabled"]
        assert r.json["mfa_key"]
    else:
        assert r.json["api_key"]
        assert not r.json["mfa_enabled"]
        assert r.json["mfa_key"] is None