fix: preserve data granularity and recover tasks safely

This commit is contained in:
Codex
2026-10-11 14:18:56 +08:00
parent 23f3a15a15
commit 603184549b
29 changed files with 4557 additions and 418 deletions
+10
View File
@@ -66,3 +66,13 @@ def test_import_yam_sqlite_keeps_year_and_score_scope(client, tmp_path):
assert rows[0]["year"] == 2026
assert rows[0]["score_year"] == 2025
assert rows[0]["score_scope"] == "discipline"
def test_yam_seed_json_imports_school_index_without_inventing_admissions(client):
payload = [{'dwdm': '10001', 'dwmc': '北京大学', 'zydm': '081200', 'zymc': '计算机科学与技术', 'szss': '北京', 'data': [], 'sign': 'token-must-not-copy'}]
response = client.post('/api/import', files={'file': ('yam-seed.json', json.dumps(payload).encode())})
assert response.status_code == 200, response.text
assert response.json()['records'] == 0
assert response.json()['indexed_schools'] == 1
assert client.get('/api/catalog').json()['total'] == 0
assert 'token-must-not-copy' not in client.get('/api/schools').text