Rename file_descriptor usage to file_object

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-07-26 15:14:53 -04:00
parent fd0d5728a1
commit 9752584135
3 changed files with 10 additions and 10 deletions

View File

@@ -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,
}
)

View File

@@ -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,
}
)

View File

@@ -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
}
)