Document tests layout tweaks

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-10-13 15:28:41 -04:00
parent ce6e568001
commit 8aa2567a56
2 changed files with 9 additions and 8 deletions

View File

@@ -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',

View File

@@ -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)