Files

21 lines
627 B
Python

from pathlib import Path
from fastapi.testclient import TestClient
from app.main import app
STATIC = Path(__file__).resolve().parent.parent / "app" / "static"
def test_periode_exige_jeton():
assert TestClient(app).get("/api/v1/mails/periode?jours=7").status_code == 401
def test_vue_groupes_presente():
js = (STATIC / "app.js").read_text(encoding="utf-8")
assert "vueGroupes" in js and "/mails/periode" in js and "etiquettes" in js
assert "innerHTML" not in js
def test_statiques_sans_cache_navigateur():
r = TestClient(app).get("/static/app.css")
assert r.headers["cache-control"] == "no-cache"