diff --git a/mayan/apps/documents/tests/mixins.py b/mayan/apps/documents/tests/mixins.py index fb1e4875df..8f1720d7e0 100644 --- a/mayan/apps/documents/tests/mixins.py +++ b/mayan/apps/documents/tests/mixins.py @@ -70,9 +70,17 @@ class DocumentTestMixin(object): self.test_document = document self.test_documents.append(document) self.test_document_page = document.latest_version.pages.first() + self.test_document_version = document.latest_version class DocumentTypeViewTestMixin(object): + def _create_document_transformation(self): + layer_saved_transformations.add_transformation_to( + obj=self.test_document.pages.first(), + transformation_class=TEST_TRANSFORMATION_CLASS, + arguments=TEST_TRANSFORMATION_ARGUMENT + ) + def _request_test_document_type_create_view(self): return self.post( viewname='documents:document_type_create', diff --git a/mayan/apps/documents/tests/test_document_views.py b/mayan/apps/documents/tests/test_document_views.py index 381a71211d..6d6444cd42 100644 --- a/mayan/apps/documents/tests/test_document_views.py +++ b/mayan/apps/documents/tests/test_document_views.py @@ -22,16 +22,9 @@ from .literals import ( from .mixins import DocumentViewTestMixin -class DocumentsViewsTestCase( +class DocumentViewTestCase( LayerTestMixin, DocumentViewTestMixin, GenericDocumentViewTestCase ): - def _create_document_transformation(self): - layer_saved_transformations.add_transformation_to( - obj=self.test_document.pages.first(), - transformation_class=TEST_TRANSFORMATION_CLASS, - arguments=TEST_TRANSFORMATION_ARGUMENT - ) - def test_document_view_no_permissions(self): response = self._request_document_properties_view() self.assertEqual(response.status_code, 404)