Files
mayan-edms/mayan/apps/linking/tests/test_models.py
Roberto Rosario 8e69178e07 Project: Switch to full app paths
Instead of inserting the path of the apps into the Python app,
the apps are now referenced by their full import path.

This app name claves with external or native Python libraries.
Example: Mayan statistics app vs. Python new statistics library.

Every app reference is now prepended with 'mayan.apps'.

Existing config.yml files need to be updated manually.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-12-05 02:04:20 -04:00

25 lines
727 B
Python

from __future__ import unicode_literals
from django.test import override_settings
from mayan.apps.documents.tests import GenericDocumentTestCase
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)
self.assertEqual(
smart_link.get_dynamic_label(document=self.document),
self.document.label
)