feat: initial implementation taller-wox.fitlabs.dev
Portal FastAPI + 5 endpoints REST para Bootcamp Agentic AI con watsonx Orchestrate (FactorIT). Single container, Coolify-ready. - Landing brandeado FIT con formulario de registro (honeypot anti-bot) - Tokens itsdangerous para descargas (24h expiry) - 5 endpoints API: historical/available procedures, member-insights, schedule, generate-report (Jinja2 + Plotly) - SQLite con upsert-on-email para leads + log de descargas - Admin endpoints (HTTP Basic): leads.json, leads.csv, stats - 23 tests pytest pasando - Dockerfile listo para Coolify con volúmenes persistentes (/app/leads.db, /app/app/data/reports_output, /app/material) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
23
tests/test_reports_api.py
Normal file
23
tests/test_reports_api.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_generate_report_with_care_report_preset(client):
|
||||
response = client.post(
|
||||
"/api/reports/generate-report",
|
||||
json={"layout_config": json.dumps(["care_report"])},
|
||||
)
|
||||
assert response.status_code == 200
|
||||
body = response.json()
|
||||
assert "public_url" in body
|
||||
assert body["public_url"].endswith(".html")
|
||||
|
||||
report_id = body["public_url"].rsplit("/", 1)[-1]
|
||||
output_dir = Path(os.environ["REPORTS_OUTPUT_DIR"])
|
||||
assert (output_dir / report_id).exists()
|
||||
content = (output_dir / report_id).read_text()
|
||||
assert "Care Report" in content
|
||||
assert "Customer Overview" in content
|
||||
assert "Claim Review Summary" in content
|
||||
assert "<table" in content
|
||||
Reference in New Issue
Block a user