支持一楼活动照片多选直传,ZIP改为可选文档附件
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user