diff --git a/src/documents/tests/test_api_bulk_download.py b/src/documents/tests/test_api_bulk_download.py index 31bf182b5..c14b45614 100644 --- a/src/documents/tests/test_api_bulk_download.py +++ b/src/documents/tests/test_api_bulk_download.py @@ -80,7 +80,7 @@ class TestBulkDownload(DirectoriesMixin, APITestCase): self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response["Content-Type"], "application/zip") - with zipfile.ZipFile(io.BytesIO(response.content)) as zipf: + with zipfile.ZipFile(io.BytesIO(response.getvalue())) as zipf: self.assertEqual(len(zipf.filelist), 2) self.assertIn("2021-01-01 document A.pdf", zipf.namelist()) self.assertIn("2020-03-21 document B.jpg", zipf.namelist()) @@ -101,7 +101,7 @@ class TestBulkDownload(DirectoriesMixin, APITestCase): self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response["Content-Type"], "application/zip") - with zipfile.ZipFile(io.BytesIO(response.content)) as zipf: + with zipfile.ZipFile(io.BytesIO(response.getvalue())) as zipf: self.assertEqual(len(zipf.filelist), 2) self.assertIn("2021-01-01 document A.pdf", zipf.namelist()) self.assertIn("2020-03-21 document B.pdf", zipf.namelist()) @@ -122,7 +122,7 @@ class TestBulkDownload(DirectoriesMixin, APITestCase): self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response["Content-Type"], "application/zip") - with zipfile.ZipFile(io.BytesIO(response.content)) as zipf: + with zipfile.ZipFile(io.BytesIO(response.getvalue())) as zipf: self.assertEqual(len(zipf.filelist), 3) self.assertIn("originals/2021-01-01 document A.pdf", zipf.namelist()) self.assertIn("archive/2020-03-21 document B.pdf", zipf.namelist()) @@ -156,7 +156,7 @@ class TestBulkDownload(DirectoriesMixin, APITestCase): self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response["Content-Type"], "application/zip") - with zipfile.ZipFile(io.BytesIO(response.content)) as zipf: + with zipfile.ZipFile(io.BytesIO(response.getvalue())) as zipf: self.assertEqual(len(zipf.filelist), 2) self.assertIn("2021-01-01 document A.pdf", zipf.namelist()) @@ -215,7 +215,7 @@ class TestBulkDownload(DirectoriesMixin, APITestCase): self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response["Content-Type"], "application/zip") - with zipfile.ZipFile(io.BytesIO(response.content)) as zipf: + with zipfile.ZipFile(io.BytesIO(response.getvalue())) as zipf: self.assertEqual(len(zipf.filelist), 2) self.assertIn("a space name/Title 2 - Doc 3.jpg", zipf.namelist()) self.assertIn("test/This is Doc 2.pdf", zipf.namelist()) @@ -261,7 +261,7 @@ class TestBulkDownload(DirectoriesMixin, APITestCase): self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response["Content-Type"], "application/zip") - with zipfile.ZipFile(io.BytesIO(response.content)) as zipf: + with zipfile.ZipFile(io.BytesIO(response.getvalue())) as zipf: self.assertEqual(len(zipf.filelist), 2) self.assertIn("somewhere/This is Doc 2.pdf", zipf.namelist()) self.assertIn("somewhere/Title 2 - Doc 3.pdf", zipf.namelist()) @@ -310,7 +310,7 @@ class TestBulkDownload(DirectoriesMixin, APITestCase): self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response["Content-Type"], "application/zip") - with zipfile.ZipFile(io.BytesIO(response.content)) as zipf: + with zipfile.ZipFile(io.BytesIO(response.getvalue())) as zipf: self.assertEqual(len(zipf.filelist), 3) self.assertIn("originals/bill/This is Doc 2.pdf", zipf.namelist()) self.assertIn("archive/statement/Title 2 - Doc 3.pdf", zipf.namelist())