Unify and improve linking app tests for Python 3.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-09-06 16:44:47 -04:00
parent 4eab4670be
commit 91b2c99e77
2 changed files with 8 additions and 39 deletions
+2 -21
View File
@@ -1,12 +1,8 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import override_settings
from common.tests import BaseTestCase
from documents.models import DocumentType
from documents.tests import TEST_SMALL_DOCUMENT_PATH, TEST_DOCUMENT_TYPE_LABEL
from documents.tests import GenericDocumentTestCase
from ..models import SmartLink
@@ -14,22 +10,7 @@ from .literals import TEST_SMART_LINK_LABEL, TEST_SMART_LINK_DYNAMIC_LABEL
@override_settings(OCR_AUTO_OCR=False)
class SmartLinkTestCase(BaseTestCase):
def setUp(self):
super(SmartLinkTestCase, self).setUp()
self.document_type = DocumentType.objects.create(
label=TEST_DOCUMENT_TYPE_LABEL
)
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(SmartLinkTestCase, self).tearDown()
class SmartLinkTestCase(GenericDocumentTestCase):
def test_dynamic_label(self):
smart_link = SmartLink.objects.create(
label=TEST_SMART_LINK_LABEL,