Improve metadata app tests pass rate for Python 3.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-09-06 16:55:48 -04:00
parent d3af59ec06
commit e41f2f73e7
5 changed files with 14 additions and 31 deletions
@@ -9,17 +9,16 @@ from documents.permissions import permission_document_create
from documents.tests import (
GenericDocumentViewTestCase, TEST_SMALL_DOCUMENT_PATH,
)
from metadata.tests.literals import TEST_METADATA_VALUE_UNICODE
from metadata.tests.mixins import MetadataTypeMixin
from sources.models import WebFormSource
from sources.tests.literals import (
TEST_SOURCE_LABEL, TEST_SOURCE_UNCOMPRESS_N,
)
from .literals import TEST_METADATA_VALUE_UNICODE
from .mixins import MetadataTypeTestMixin
class DocumentUploadMetadataTestCase(MetadataTypeMixin, GenericDocumentViewTestCase):
class DocumentUploadMetadataTestCase(MetadataTypeTestMixin, GenericDocumentViewTestCase):
def setUp(self):
super(DocumentUploadMetadataTestCase, self).setUp()
self.login_user()
@@ -43,7 +42,7 @@ class DocumentUploadMetadataTestCase(MetadataTypeMixin, GenericDocumentViewTestC
permission=permission_document_create, obj=self.document_type
)
# Upload the test document
with open(TEST_SMALL_DOCUMENT_PATH) as file_descriptor:
with open(TEST_SMALL_DOCUMENT_PATH, 'rb') as file_descriptor:
response = self.post(
path=url, data={
'document-language': 'eng', 'source-file': file_descriptor,