Unify tests that use upload documents. Add explicit mode when opening a file.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-09-06 03:38:17 -04:00
parent 388b61ca7a
commit 4eab4670be
33 changed files with 245 additions and 423 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ from .literals import TEST_SMALL_DOCUMENT_PATH
class DocumentsLinksTestCase(GenericDocumentViewTestCase):
def test_document_version_revert_link_no_permission(self):
with open(TEST_SMALL_DOCUMENT_PATH) as file_object:
with open(TEST_SMALL_DOCUMENT_PATH, 'rb') as file_object:
self.document.new_version(file_object=file_object)
self.assertTrue(self.document.versions.count(), 2)
@@ -41,7 +41,7 @@ class DocumentsLinksTestCase(GenericDocumentViewTestCase):
# field
time.sleep(2)
with open(TEST_SMALL_DOCUMENT_PATH) as file_object:
with open(TEST_SMALL_DOCUMENT_PATH, 'rb') as file_object:
self.document.new_version(file_object=file_object)
self.assertTrue(self.document.versions.count(), 2)