Add support to update the document indexes from workflow state changes.

Add a new workflow field called internal_name for easier workflow
reference in document index templates.
Generalize the PropertyHelper class.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-06-06 20:07:15 -04:00
parent f7f0d27a05
commit 5798cabd7c
30 changed files with 497 additions and 102 deletions
+8 -22
View File
@@ -16,23 +16,25 @@ from .literals import (
@override_settings(OCR_AUTO_OCR=False)
class DocumentTestCase(BaseTestCase):
class GenericDocumentTestCase(BaseTestCase):
def setUp(self):
super(DocumentTestCase, self).setUp()
super(GenericDocumentTestCase, self).setUp()
self.document_type = DocumentType.objects.create(
label=TEST_DOCUMENT_TYPE
)
with open(TEST_DOCUMENT_PATH) as file_object:
with open(TEST_SMALL_DOCUMENT_PATH) as file_object:
self.document = self.document_type.new_document(
file_object=file_object, label='mayan_11_1.pdf'
file_object=file_object
)
def tearDown(self):
self.document_type.delete()
super(DocumentTestCase, self).tearDown()
super(GenericDocumentTestCase, self).tearDown()
class DocumentTestCase(GenericDocumentTestCase):
def test_document_creation(self):
self.assertEqual(self.document_type.label, TEST_DOCUMENT_TYPE)
@@ -194,23 +196,7 @@ class MultiPageTiffTestCase(BaseTestCase):
self.assertEqual(self.document.page_count, 2)
@override_settings(OCR_AUTO_OCR=False)
class DocumentVersionTestCase(BaseTestCase):
def setUp(self):
super(DocumentVersionTestCase, self).setUp()
self.document_type = DocumentType.objects.create(
label=TEST_DOCUMENT_TYPE
)
with open(TEST_SMALL_DOCUMENT_PATH) as file_object:
self.document = self.document_type.new_document(
file_object=file_object
)
def tearDown(self):
self.document_type.delete()
super(DocumentVersionTestCase, self).setUp()
class DocumentVersionTestCase(GenericDocumentTestCase):
def test_add_new_version(self):
self.assertEqual(self.document.versions.count(), 1)