Tests: Modernize some test cases

Update some view tests in the tags, sources and linking apps
to use the test case classes provided by the common app.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2018-12-09 17:10:27 -04:00
parent e048f31f85
commit f8c25af796
4 changed files with 104 additions and 135 deletions
+8 -1
View File
@@ -1,5 +1,6 @@
from __future__ import absolute_import, unicode_literals
from mayan.apps.common.tests import GenericViewTestCase
from mayan.apps.documents.permissions import permission_document_view
from mayan.apps.documents.tests import GenericDocumentViewTestCase
@@ -15,7 +16,7 @@ from .literals import (
)
class SmartLinkViewTestCase(GenericDocumentViewTestCase):
class SmartLinkViewTestCase(GenericViewTestCase):
def setUp(self):
super(SmartLinkViewTestCase, self).setUp()
self.login_user()
@@ -98,6 +99,12 @@ class SmartLinkViewTestCase(GenericDocumentViewTestCase):
self.assertContains(response, text='update', status_code=200)
self.assertEqual(smart_link.label, TEST_SMART_LINK_LABEL_EDITED)
class SmartLinkDocumentsViewTestCase(GenericDocumentViewTestCase):
def setUp(self):
super(SmartLinkDocumentsViewTestCase, self).setUp()
self.login_user()
def setup_smart_links(self):
smart_link = SmartLink.objects.create(
label=TEST_SMART_LINK_LABEL,