def METHOD_NAME(self, client, host, url, monkeypatch):
    def _r(*a, **kw):
        raise PycroftException
    monkeypatch.setattr(web.blueprints.host.lib_host, "host_delete", _r)
    with client.flashes_message("Fehler aufgetreten", category="error"):
        client.assert_url_ok(url(host.id), method="POST")