feat: traçabilité source systématique + viewer interactif
Ajoute source_page/source_excerpt à tous les types (biologie, imagerie, traitements, actes CCAM, antécédents, complications). Convertit antecedents et complications en types structurés (Antecedent/Complication) avec validators backward-compat pour les vieux JSON. Étend _apply_source_tracking à tous les éléments du dossier. Ajoute un endpoint /api/source-text/ et un modal interactif dans le viewer avec surlignage du texte source. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -143,3 +143,15 @@ class TestDetailPageLoads:
|
||||
"""Un fichier inexistant retourne 404."""
|
||||
response = client.get("/dossier/nonexistent.json")
|
||||
assert response.status_code == 404
|
||||
|
||||
|
||||
class TestSourceTextEndpoint:
|
||||
def test_source_text_404_nonexistent(self, client):
|
||||
"""Un dossier inexistant retourne 404."""
|
||||
response = client.get("/api/source-text/nonexistent_dossier")
|
||||
assert response.status_code == 404
|
||||
|
||||
def test_source_text_security_path_traversal(self, client):
|
||||
"""Path traversal bloqué."""
|
||||
response = client.get("/api/source-text/../../etc")
|
||||
assert response.status_code in (403, 404)
|
||||
|
||||
Reference in New Issue
Block a user