diff --git a/mayan/apps/document_states/models.py b/mayan/apps/document_states/models.py index cc6e478b1e..d29e19cd91 100644 --- a/mayan/apps/document_states/models.py +++ b/mayan/apps/document_states/models.py @@ -383,7 +383,9 @@ class WorkflowInstance(models.Model): def get_absolute_url(self): return reverse( - 'document_states:workflow_instance_detail', args=(str(self.pk),) + viewname='document_states:workflow_instance_detail', kwargs={ + 'pk': self.pk + } ) def get_context(self): diff --git a/mayan/apps/document_states/widgets.py b/mayan/apps/document_states/widgets.py index 3d49f78158..75e563baa1 100644 --- a/mayan/apps/document_states/widgets.py +++ b/mayan/apps/document_states/widgets.py @@ -18,7 +18,11 @@ def widget_transition_events(transition): def widget_workflow_diagram(workflow): return mark_safe( ''.format( - reverse('document_states:workflow_image', args=(workflow.pk,)) + reverse( + viewname='document_states:workflow_image', kwargs={ + 'pk': workflow.pk + } + ) ) ) diff --git a/mayan/apps/ocr/tests/test_api.py b/mayan/apps/ocr/tests/test_api.py index e78e031a72..b34c8a73f1 100644 --- a/mayan/apps/ocr/tests/test_api.py +++ b/mayan/apps/ocr/tests/test_api.py @@ -23,7 +23,9 @@ class OCRAPITestCase(DocumentTestMixin, BaseAPITestCase): response = self._request_document_ocr_submit_view() self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) - self.assertFalse(hasattr(self.test_document.pages.first(), 'ocr_content')) + self.assertFalse( + hasattr(self.test_document.pages.first(), 'ocr_content') + ) def test_submit_document_with_access(self): self.grant_access( @@ -32,19 +34,25 @@ class OCRAPITestCase(DocumentTestMixin, BaseAPITestCase): response = self._request_document_ocr_submit_view() self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED) - self.assertTrue(hasattr(self.test_document.pages.first(), 'ocr_content')) + self.assertTrue( + hasattr(self.test_document.pages.first(), 'ocr_content') + ) def _request_document_version_ocr_submit_view(self): return self.post( - viewname='rest_api:document-version-ocr-submit-view', - args=(self.test_document.pk, self.test_document.latest_version.pk,) + viewname='rest_api:document-version-ocr-submit-view', kwargs={ + 'document_pk': self.test_document.pk, + 'version_pk': self.test_document.latest_version.pk + } ) def test_submit_document_version_no_access(self): response = self._request_document_version_ocr_submit_view() self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) - self.assertFalse(hasattr(self.test_document.pages.first(), 'ocr_content')) + self.assertFalse( + hasattr(self.test_document.pages.first(), 'ocr_content') + ) def test_submit_document_version_with_access(self): self.grant_access( @@ -53,15 +61,17 @@ class OCRAPITestCase(DocumentTestMixin, BaseAPITestCase): response = self._request_document_version_ocr_submit_view() self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED) - self.assertTrue(hasattr(self.test_document.pages.first(), 'ocr_content')) + self.assertTrue( + hasattr(self.test_document.pages.first(), 'ocr_content') + ) def _request_document_page_content_view(self): return self.get( - viewname='rest_api:document-page-ocr-content-view', - args=( - self.test_document.pk, self.test_document.latest_version.pk, - self.test_document.latest_version.pages.first().pk, - ) + viewname='rest_api:document-page-ocr-content-view', kwargs={ + 'document_pk': self.test_document.pk, + 'version_pk': self.test_document.latest_version.pk, + 'page_pk': self.test_document.latest_version.pages.first().pk, + } ) def test_get_document_version_page_content_no_access(self):