Split document.tests.test_views.
Signed-off-by: Michael Price <loneviking72@gmail.com>
This commit is contained in:
committed by
Roberto Rosario
parent
77777deec5
commit
96836065a8
31
mayan/apps/documents/tests/test_document_page_views.py
Normal file
31
mayan/apps/documents/tests/test_document_page_views.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from ..permissions import permission_document_view
|
||||
|
||||
from .base import GenericDocumentViewTestCase
|
||||
|
||||
|
||||
class DocumentPageViewTestCase(GenericDocumentViewTestCase):
|
||||
def setUp(self):
|
||||
super(DocumentPageViewTestCase, self).setUp()
|
||||
self.login_user()
|
||||
|
||||
def _document_page_list_view(self):
|
||||
return self.get(
|
||||
'documents:document_pages', args=(self.document.pk,)
|
||||
)
|
||||
|
||||
def test_document_page_list_view_no_permission(self):
|
||||
response = self._document_page_list_view()
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
def test_document_page_list_view_with_access(self):
|
||||
self.grant_access(
|
||||
obj=self.document, permission=permission_document_view
|
||||
)
|
||||
response = self._document_page_list_view()
|
||||
self.assertContains(
|
||||
response, text=self.document.label, status_code=200
|
||||
)
|
||||
Reference in New Issue
Block a user