This commit is contained in:
team3
2026-07-14 00:15:03 +02:00
parent af0e3c0629
commit 3f6114681c
22 changed files with 757 additions and 307 deletions

View File

@@ -16,7 +16,7 @@ async def test_export_import_roundtrip():
pipeline.lauf_starten(topic)
await pipeline._laeufe[topic]
tabellen = ("quellen", "soll", "atome", "anker", "kanten", "artefakte",
tabellen = ("quellen", "soll", "themen", "atome", "anker", "kanten", "artefakte",
"lernziele", "bausteine", "kapitel", "sections", "auftraege",
"runs", "befunde", "events", "leitner")
vorher = {t: len(db.query(f"SELECT * FROM {t}", ())) for t in tabellen}
@@ -35,6 +35,11 @@ async def test_export_import_roundtrip():
" ('gemerged','verworfen')", (topic,)):
assert db.one("SELECT id FROM anker WHERE atom_id=?", (a["id"],))
assert a["soll_id"] and db.one("SELECT id FROM soll WHERE id=?", (a["soll_id"],))
# Themen-Verweise remappt: bestätigte Punkte und Bausteine zeigen auf echte Themen
for p in db.query("SELECT * FROM soll WHERE topic=? AND status='bestaetigt'", (topic,)):
assert p["thema_id"] and db.one("SELECT id FROM themen WHERE id=?", (p["thema_id"],))
for b in db.query("SELECT * FROM bausteine WHERE topic=?", (topic,)):
assert b["thema_id"] and db.one("SELECT id FROM themen WHERE id=?", (b["thema_id"],))
for s in db.query("SELECT belege FROM soll WHERE topic=? AND status='bestaetigt'",
(topic,)):
for b in db.uj(s["belege"]):