diff --git a/mayan/apps/document_states/views/workflow_instance_views.py b/mayan/apps/document_states/views/workflow_instance_views.py index ed13dc774c..66750fc468 100644 --- a/mayan/apps/document_states/views/workflow_instance_views.py +++ b/mayan/apps/document_states/views/workflow_instance_views.py @@ -76,7 +76,7 @@ class WorkflowInstanceDetailView(SingleObjectListView): 'no_results_main_link': link_workflow_instance_transition.resolve( context=RequestContext( dict_={'object': self.get_workflow_instance()}, - request=self.request + request=self.request ) ), 'no_results_text': _( diff --git a/mayan/apps/tags/tests/test_actions.py b/mayan/apps/tags/tests/test_actions.py index 8429146a1e..0aa8c55078 100644 --- a/mayan/apps/tags/tests/test_actions.py +++ b/mayan/apps/tags/tests/test_actions.py @@ -1,5 +1,7 @@ from __future__ import unicode_literals +from mayan.apps.common.tests import GenericViewTestCase +from mayan.apps.document_states.tests.mixins import WorkflowTestMixin from mayan.apps.document_states.tests.test_actions import ActionTestCase from ..models import Tag @@ -29,3 +31,33 @@ class TagActionTestCase(ActionTestCase): action.execute(context={'document': self.test_document}) self.assertEqual(self.tag.documents.count(), 0) + + +class TagActionViewTestCase(WorkflowTestMixin, GenericViewTestCase): + def test_tag_attach_action_create_view(self): + self._create_test_workflow() + self._create_test_workflow_state() + + response = self.get( + viewname='document_states:setup_workflow_state_action_create', + kwargs={ + 'pk': self.test_workflow_state.pk, + 'class_path': 'mayan.apps.tags.workflow_actions.AttachTagAction' + } + ) + + self.assertEqual(response.status_code, 200) + + def test_tag_remove_action_create_view(self): + self._create_test_workflow() + self._create_test_workflow_state() + + response = self.get( + viewname='document_states:setup_workflow_state_action_create', + kwargs={ + 'pk': self.test_workflow_state.pk, + 'class_path': 'mayan.apps.tags.workflow_actions.RemoveTagAction' + } + ) + + self.assertEqual(response.status_code, 200) diff --git a/mayan/apps/tags/workflow_actions.py b/mayan/apps/tags/workflow_actions.py index 53ea2fe620..31d50c757b 100644 --- a/mayan/apps/tags/workflow_actions.py +++ b/mayan/apps/tags/workflow_actions.py @@ -38,7 +38,8 @@ class AttachTagAction(WorkflowAction): logger.debug('user: %s', user) queryset = AccessControlList.objects.restrict_queryset( - self.permission, user, queryset=Tag.objects.all() + permission=self.permission, queryset=Tag.objects.all(), + user=user ) self.fields['tags']['kwargs']['queryset'] = queryset