Fix document parsing tool view typo
Closes GitLab issue #615. Thanks to Tyler Page (@iamtpage) for the report. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
==================
|
||||
* Fix document type change view. Closes GitLab issue #614
|
||||
Thanks to Christoph Roeder (@brightdroid) for the report.
|
||||
* Fix document parsing tool view typo. Closes GitLab issue #615.
|
||||
Thanks to Tyler Page (@iamtpage) for the report.
|
||||
|
||||
3.2.1 (2019-06-14)
|
||||
==================
|
||||
|
||||
@@ -9,6 +9,8 @@ Changes
|
||||
|
||||
- Fix document type change view. Closes GitLab issue #614.
|
||||
Thanks to Christoph Roeder (@brightdroid) for the report.
|
||||
- Fix document parsing tool view typo. Closes GitLab issue #615.
|
||||
Thanks to Tyler Page (@iamtpage) for the report.
|
||||
|
||||
Removals
|
||||
--------
|
||||
@@ -98,5 +100,6 @@ Bugs fixed or issues closed
|
||||
---------------------------
|
||||
|
||||
- :gitlab-issue:`614` change type exception
|
||||
- :gitlab-issue:`615` TypeError: success() got an unexpected keyword argument 'requrest'
|
||||
|
||||
.. _PyPI: https://pypi.python.org/pypi/mayan-edms/
|
||||
|
||||
@@ -6,9 +6,7 @@ from mayan.apps.documents.tests import (
|
||||
GenericDocumentViewTestCase, TEST_HYBRID_DOCUMENT
|
||||
)
|
||||
|
||||
from ..permissions import (
|
||||
permission_content_view, permission_document_type_parsing_setup
|
||||
)
|
||||
from ..permissions import permission_content_view, permission_parse_document
|
||||
from ..utils import get_document_content
|
||||
|
||||
from .literals import TEST_DOCUMENT_CONTENT
|
||||
@@ -100,9 +98,49 @@ class DocumentContentViewsTestCase(GenericDocumentViewTestCase):
|
||||
|
||||
def test_document_type_parsing_settings_view_with_access(self):
|
||||
self.grant_access(
|
||||
permission=permission_document_type_parsing_setup,
|
||||
permission=permission_parse_document,
|
||||
obj=self.test_document.document_type
|
||||
)
|
||||
|
||||
response = self._request_test_document_type_parsing_settings()
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
class DocumentContentToolsViewsTestCase(GenericDocumentViewTestCase):
|
||||
_skip_file_descriptor_test = True
|
||||
|
||||
# Ensure we use a PDF file
|
||||
test_document_filename = TEST_HYBRID_DOCUMENT
|
||||
|
||||
def _request_document_parsing_tool_view(self):
|
||||
return self.post(
|
||||
viewname='document_parsing:document_type_submit', data={
|
||||
'document_type': self.test_document_type.pk
|
||||
}
|
||||
)
|
||||
|
||||
def _get_document_content(self):
|
||||
return ''.join(list(get_document_content(document=self.test_document)))
|
||||
|
||||
def test_document_parsing_tool_view_no_permission(self):
|
||||
|
||||
response = self._request_document_parsing_tool_view()
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertNotContains(
|
||||
response=response, status_code=200,
|
||||
text=self.test_document_type.label
|
||||
)
|
||||
|
||||
self.assertNotEqual(
|
||||
self._get_document_content(), TEST_DOCUMENT_CONTENT
|
||||
)
|
||||
|
||||
def test_document_parsing_tool_view_with_permission(self):
|
||||
self.grant_permission(permission=permission_parse_document)
|
||||
|
||||
response = self._request_document_parsing_tool_view()
|
||||
self.assertEqual(response.status_code, 302)
|
||||
|
||||
self.assertEqual(
|
||||
self._get_document_content(), TEST_DOCUMENT_CONTENT
|
||||
)
|
||||
|
||||
@@ -185,7 +185,7 @@ class DocumentTypeSubmitView(FormView):
|
||||
'%(count)d documents added to the parsing queue.'
|
||||
) % {
|
||||
'count': count,
|
||||
}, requrest=self.request
|
||||
}, request=self.request
|
||||
)
|
||||
|
||||
return HttpResponseRedirect(redirect_to=self.get_success_url())
|
||||
|
||||
Reference in New Issue
Block a user