支持一楼活动照片多选直传,ZIP改为可选文档附件

This commit is contained in:
2026-11-12 14:01:12 +08:00
parent f8b3f3f7d7
commit 3404fff5fc
8 changed files with 200 additions and 56 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ class CenterExportTests(ApiTestCase):
async def test_material_zip_validation_and_export_visible_activities_only(self):
owner=await register(self.client,'materialsowner');other=await register(self.client,'materialsother');c=self.client
with tempfile.TemporaryDirectory() as directory,patch.object(self.m,'_db_path',Path(directory)/'test.db'):
for raw in [b'not zip',package([('../bad.txt','bad')]),package([('only.txt','no photos')]),package([('script.exe','bad')])]:
for raw in [b'not zip',package([('../bad.txt','bad')]),package([]),package([('script.exe','bad')])]:
self.assertEqual((await c.post('/api/center/materials',headers=auth(owner['token']),content=raw)).status_code,422)
response=await c.post('/api/center/materials',headers=auth(owner['token']),content=package())
self.assertEqual(response.status_code,200,response.text);material=response.json()