Backport test improvements

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-20 02:39:57 -04:00
parent bfcad278aa
commit 0267c79b07
108 changed files with 5432 additions and 4683 deletions
+3 -6
View File
@@ -1,7 +1,5 @@
from __future__ import unicode_literals
from django.test import override_settings
from mayan.apps.documents.tests import GenericDocumentTestCase
from ..models import SmartLink
@@ -9,16 +7,15 @@ from ..models import SmartLink
from .literals import TEST_SMART_LINK_LABEL, TEST_SMART_LINK_DYNAMIC_LABEL
@override_settings(OCR_AUTO_OCR=False)
class SmartLinkTestCase(GenericDocumentTestCase):
def test_dynamic_label(self):
smart_link = SmartLink.objects.create(
label=TEST_SMART_LINK_LABEL,
dynamic_label=TEST_SMART_LINK_DYNAMIC_LABEL
)
smart_link.document_types.add(self.document_type)
smart_link.document_types.add(self.test_document_type)
self.assertEqual(
smart_link.get_dynamic_label(document=self.document),
self.document.label
smart_link.get_dynamic_label(document=self.test_document),
self.test_document.label
)