This commit is contained in:
team3
2026-07-12 04:20:07 +02:00
parent 14bcf1b8e9
commit a284e03225
29 changed files with 866 additions and 329 deletions

View File

@@ -42,3 +42,10 @@ async def test_export_import_roundtrip():
for b in db.query("SELECT * FROM bausteine WHERE topic=?", (topic,)):
assert db.one("SELECT id FROM kapitel WHERE id=?", (b["kapitel_id"],))
assert db.one("SELECT baustein_id FROM sections WHERE baustein_id=?", (b["id"],))
# Marker-Remap: jede Marker-id im importierten Text existiert (aak: 421/421 tot)
atom_ids = {a["id"] for a in db.query("SELECT id FROM atome WHERE topic=?", (topic,))}
for s in db.query("SELECT s.* FROM sections s JOIN bausteine b ON b.id=s.baustein_id"
" WHERE b.topic=?", (topic,)):
for feld in ("text_lang", "text_kompakt"):
for m in re.findall(r"<!--\s*atom:\s*(\d+)\s*\|", s[feld] or ""):
assert int(m) in atom_ids, f"toter Marker {m}"