From 235882cc2f8d87e6e9ccee72d70f7d737c7f3f41 Mon Sep 17 00:00:00 2001 From: admin user Date: Wed, 10 Jun 2026 23:07:03 +0000 Subject: [PATCH] =?UTF-8?q?feat(welcome):=20p=C3=A1gina=20de=20bienvenida?= =?UTF-8?q?=20en=20/=20del=20Golden=20Path=20(shape=201.2.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/tests/test_welcome.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 code/tests/test_welcome.py diff --git a/code/tests/test_welcome.py b/code/tests/test_welcome.py new file mode 100644 index 0000000..dfed778 --- /dev/null +++ b/code/tests/test_welcome.py @@ -0,0 +1,21 @@ +"""Cubre la ruta raíz `/`: página de bienvenida por defecto del Golden Path.""" + +from fastapi.testclient import TestClient + + +def test_root_serves_welcome_page(client: TestClient) -> None: + response = client.get("/") + assert response.status_code == 200 + assert "text/html" in response.headers.get("content-type", "") + body = response.text + # Mensaje clave: el desarrollo del tenant reemplaza esta página tras commit+push. + assert "commit" in body and "push" in body + assert "plataforma" in body.lower() + # En el template (sin renderizar) el placeholder sigue presente. + assert "__APP_NAME__" in body + + +def test_root_excluded_from_openapi_schema(client: TestClient) -> None: + # La welcome page no debe ensuciar el contrato OpenAPI del dev (include_in_schema=False). + schema = client.get("/openapi.json").json() + assert "/" not in schema.get("paths", {})