def METHOD_NAME(app):
    from cryptoadvance.specter.server_endpoints.controller import server_error_csrf
    with app.test_request_context(environ_base={"HTTP_ACCEPT": "application/json"}):
        assert server_error_csrf(CSRFError("Muh!"))["error"].startswith(
            "Session expired (CSRF)."
        )
    with app.test_request_context(environ_base={"HTTP_ACCEPT": "*/*"}):
        with patch(
            "cryptoadvance.specter.server_endpoints.controller.flash"
        ) as mock_flash:
            response = server_error_csrf(CSRFError("Muh!"))
            assert response.status_code == 302
            assert mock_flash.called