def METHOD_NAME(app):
    user = CreateTestData.create_user("a_user")
    url = url_for("user.delete", id=user.id)
    extra_environ = {"REMOTE_USER": "testsysadmin"}
    redirect_url = url_for("user.index", qualified=True)
    res = app.post(url, extra_environ=extra_environ, follow_redirects=False)
    assert user.is_deleted(), user
    assert res.headers["Location"].startswith(
        redirect_url
    )