This commit is contained in:
@@ -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"},
|
||||
|
||||
Reference in New Issue
Block a user