From ebe96336653f4bbe40d4cb14abeb0bc5fc05e295 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 5 Apr 2018 19:47:29 -0400 Subject: [PATCH] Auto upload a document when using the generic document test case but give subclasses the choice to disable it. Signed-off-by: Roberto Rosario --- mayan/apps/documents/tests/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mayan/apps/documents/tests/base.py b/mayan/apps/documents/tests/base.py index 9dc5c89f6f..70a33802af 100644 --- a/mayan/apps/documents/tests/base.py +++ b/mayan/apps/documents/tests/base.py @@ -19,6 +19,7 @@ from .literals import ( @override_settings(OCR_AUTO_OCR=False) class GenericDocumentTestCase(BaseTestCase): + auto_upload_document = True test_document_filename = TEST_SMALL_DOCUMENT_FILENAME def upload_document(self): @@ -38,8 +39,8 @@ class GenericDocumentTestCase(BaseTestCase): self.document_type = DocumentType.objects.create( label=TEST_DOCUMENT_TYPE_LABEL ) - - self.document = self.upload_document() + if self.auto_upload_document: + self.document = self.upload_document() def tearDown(self): self.document_type.delete()