Allow multitle expected_content_types in tests

Some tests return 'text/html' or 'text/html; charset=utf-8'
which are essentially the same if they are tested in debug mode.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-11-11 02:20:58 -04:00
parent 6bd672a756
commit b0677a8bda
9 changed files with 37 additions and 23 deletions
@@ -187,10 +187,12 @@ class DocumentViewTestCase(
self.assertEqual(response.status_code, 403)
def test_document_download_view_with_permission(self):
# Set the expected_content_type for
# Set the expected_content_types for
# common.tests.mixins.ContentTypeCheckMixin
self.expected_content_type = '{}; charset=utf-8'.format(
self.test_document.file_mimetype
self.expected_content_types = (
'{}; charset=utf-8'.format(
self.test_document.file_mimetype
),
)
self.grant_access(
@@ -212,10 +214,12 @@ class DocumentViewTestCase(
self.assertEqual(response.status_code, 403)
def test_document_multiple_download_view_with_permission(self):
# Set the expected_content_type for
# Set the expected_content_types for
# common.tests.mixins.ContentTypeCheckMixin
self.expected_content_type = '{}; charset=utf-8'.format(
self.test_document.file_mimetype
self.expected_content_types = (
'{}; charset=utf-8'.format(
self.test_document.file_mimetype
),
)
self.grant_access(
obj=self.test_document, permission=permission_document_download
@@ -236,10 +240,12 @@ class DocumentViewTestCase(
self.assertEqual(response.status_code, 403)
def test_document_version_download_view_with_permission(self):
# Set the expected_content_type for
# Set the expected_content_types for
# common.tests.mixins.ContentTypeCheckMixin
self.expected_content_type = '{}; charset=utf-8'.format(
self.test_document.latest_version.mimetype
self.expected_content_types = (
'{}; charset=utf-8'.format(
self.test_document.latest_version.mimetype
),
)
self.grant_access(
@@ -259,10 +265,12 @@ class DocumentViewTestCase(
)
def test_document_version_download_preserve_extension_view_with_permission(self):
# Set the expected_content_type for
# Set the expected_content_types for
# common.tests.mixins.ContentTypeCheckMixin
self.expected_content_type = '{}; charset=utf-8'.format(
self.test_document.latest_version.mimetype
self.expected_content_types = (
'{}; charset=utf-8'.format(
self.test_document.latest_version.mimetype
),
)
self.grant_access(