Files
template-web-backend-python/code/tests/test_welcome.py
admin user 235882cc2f
All checks were successful
__APP_NAME__ — build & deploy / ¿Credenciales de build listas? (push) Successful in 0s
__APP_NAME__ — build & deploy / Calidad + build + push (push) Has been skipped
__APP_NAME__ — build & deploy / ¿Cluster del tenant listo? (push) Has been skipped
__APP_NAME__ — build & deploy / Helm upgrade --install (push) Has been skipped
feat(welcome): página de bienvenida en / del Golden Path (shape 1.2.0)
2026-06-10 23:07:03 +00:00

22 lines
891 B
Python

"""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", {})