fix: export restorable CSV backups
ci / docker (push) Successful in 4m24s

This commit is contained in:
2026-09-08 10:19:13 +08:00
parent 84e14f39e0
commit 3528e880f6
4 changed files with 106 additions and 12 deletions
+12
View File
@@ -359,6 +359,18 @@ def test_restore_replace_recovers_habits_and_task_links_without_tags(client):
assert "tags" not in exported.json()
assert "task_tags" not in exported.json()
exported_csv = client.get("/api/v1/export.csv")
assert exported_csv.status_code == 200
assert exported_csv.headers["content-type"].startswith("text/csv")
assert "dodo-export.csv" in exported_csv.headers["content-disposition"]
assert exported_csv.content.startswith(b"\xef\xbb\xbfentity,data")
restored_csv = client.post(
"/api/v1/restore.csv?mode=merge",
files={"file": ("dodo-export.csv", exported_csv.content, "text/csv")},
)
assert restored_csv.status_code == 200
client.post(
"/api/v1/habits",
json={"name": "深蹲", "kind": "boolean", "schedule_type": "daily"},