diff --git a/mayan/apps/documents/tests/test_api.py b/mayan/apps/documents/tests/test_api.py index 0ddcc9164f..2a16ea74ae 100644 --- a/mayan/apps/documents/tests/test_api.py +++ b/mayan/apps/documents/tests/test_api.py @@ -154,11 +154,11 @@ class DocumentAPITestCase(DocumentTestMixin, BaseAPITestCase): auto_upload_document = False def _request_document_upload(self): - with open(TEST_DOCUMENT_PATH, mode='rb') as file_descriptor: + with open(TEST_DOCUMENT_PATH, mode='rb') as file_object: return self.post( viewname='rest_api:document-list', data={ 'document_type': self.test_document_type.pk, - 'file': file_descriptor + 'file': file_object } ) @@ -208,12 +208,12 @@ class DocumentAPITestCase(DocumentTestMixin, BaseAPITestCase): # is the latest. time.sleep(1) - with open(TEST_DOCUMENT_PATH, mode='rb') as file_descriptor: + with open(TEST_DOCUMENT_PATH, mode='rb') as file_object: return self.post( viewname='rest_api:document-version-list', kwargs={ 'pk': self.test_document.pk, }, data={ - 'comment': '', 'file': file_descriptor, + 'comment': '', 'file': file_object, } ) diff --git a/mayan/apps/metadata/tests/test_wizard_steps.py b/mayan/apps/metadata/tests/test_wizard_steps.py index 2d98671079..cd0e49497e 100644 --- a/mayan/apps/metadata/tests/test_wizard_steps.py +++ b/mayan/apps/metadata/tests/test_wizard_steps.py @@ -45,10 +45,10 @@ class DocumentUploadMetadataTestCase(MetadataTypeTestMixin, GenericDocumentViewT ) # Upload the test document - with open(TEST_SMALL_DOCUMENT_PATH, mode='rb') as file_descriptor: + with open(TEST_SMALL_DOCUMENT_PATH, mode='rb') as file_object: response = self.post( path=url.to_string(), data={ - 'document-language': 'eng', 'source-file': file_descriptor, + 'document-language': 'eng', 'source-file': file_object, 'document_type_id': self.test_document_type.pk, } ) @@ -72,10 +72,10 @@ class DocumentUploadMetadataTestCase(MetadataTypeTestMixin, GenericDocumentViewT ) # Upload the test document - with open(TEST_SMALL_DOCUMENT_PATH, mode='rb') as file_descriptor: + with open(TEST_SMALL_DOCUMENT_PATH, mode='rb') as file_object: response = self.post( path=url.to_string(), data={ - 'document-language': 'eng', 'source-file': file_descriptor, + 'document-language': 'eng', 'source-file': file_object, 'document_type_id': self.test_document_type.pk, } ) diff --git a/mayan/apps/sources/tests/test_views.py b/mayan/apps/sources/tests/test_views.py index 03ecbbc72d..591fecbd69 100644 --- a/mayan/apps/sources/tests/test_views.py +++ b/mayan/apps/sources/tests/test_views.py @@ -152,11 +152,11 @@ class DocumentUploadIssueTestCase(GenericDocumentViewTestCase): self.assertEqual(WebFormSource.objects.count(), 1) # Upload the test document - with open(TEST_SMALL_DOCUMENT_PATH, mode='rb') as file_descriptor: + with open(TEST_SMALL_DOCUMENT_PATH, mode='rb') as file_object: self.post( viewname='sources:upload_interactive', data={ 'document-language': 'eng', - 'source-file': file_descriptor, + 'source-file': file_object, 'document_type_id': self.test_document_type.pk } )