def testItemDownloadAndChildren(self):
    curItem = self._createItem(self.publicFolder['_id'], 'test_for_download', 'fake description', self.users[0])
    self._testUploadFileToItem(curItem, 'file_1', self.users[0], 'foobar')
    self._testDownloadSingleFileItem(curItem, self.users[0], 'foobar')
    self._testDownloadMultiFileItem(curItem, self.users[0], {'file_1': 'foobar'}, format='zip')
    self._testUploadFileToItem(curItem, 'file_2', self.users[0], 'foobz')
    resp = self.request(path=('/item/%s/files' % curItem['_id']), method='GET', user=self.users[0])
    self.assertStatusOk(resp)
    self.assertEqual(resp.json[0]['name'], 'file_1')
    self.assertEqual(resp.json[1]['name'], 'file_2')
    self.assertEqual(resp.json[0]['size'], 6)
    self.assertEqual(resp.json[1]['size'], 5)
    self._testDownloadMultiFileItem(curItem, self.users[0], {'file_1': 'foobar', 'file_2': 'foobz'})
def testItemDownloadAndChildren(self):
    curItem = self._createItem(self.publicFolder['_id'], 'test_for_download', 'fake description', self.users[0])
    self._testUploadFileToItem(curItem, 'file_1', self.users[0], 'foobar')
    self._testDownloadSingleFileItem(curItem, self.users[0], 'foobar')
    self._testDownloadMultiFileItem(curItem, self.users[0], {'file_1': 'foobar'}, format='zip')
    self._testUploadFileToItem(curItem, 'file_2', self.users[0], 'foobz')
    resp = self.request(path=('/item/%s/files' % curItem['_id']), method='GET', user=self.users[0])
    self.assertStatusOk(resp)
    self.assertEqual(resp.json[0]['name'], 'file_1')
    self.assertEqual(resp.json[1]['name'], 'file_2')
    self.assertEqual(resp.json[0]['size'], 6)
    self.assertEqual(resp.json[1]['size'], 5)
    self._testDownloadMultiFileItem(curItem, self.users[0], {'file_1': 'foobar', 'file_2': 'foobz'})