diff --git a/tests/unit/test_cloud_routes.py b/tests/unit/test_cloud_routes.py index daa292c72..6bb1e89a2 100644 --- a/tests/unit/test_cloud_routes.py +++ b/tests/unit/test_cloud_routes.py @@ -1316,7 +1316,11 @@ def test_generate_dashboard_url_service_error(self): } ) assert response.status_code == 500 - assert "Failed to generate" in response.json()["detail"] + # The 500 body must be sanitized (CWE-209): a static message, never the + # caught exception text. See reporting_routes.generate_dashboard_url. + detail = response.json()["detail"] + assert detail == "Internal server error" + assert "Looker unavailable" not in detail def test_generate_dashboard_url_missing_fields(self): """Missing required fields return 422."""