Rename file_descriptor usage to file_object
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -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,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user