def test_workflow_template_transition_edit_view_with_access(self):
    self._create_test_workflow_template_transition()
    test_workflow_template_transition_label = self.test_workflow_template_transition.label
    self.grant_access(obj=self.test_workflow_template, permission=permission_workflow_template_edit)
    self._clear_events()
    response = self._request_test_workflow_template_transition_edit_view()
    self.assertEqual(response.status_code, 302)
    self.test_workflow_template_transition.refresh_from_db()
    self.assertNotEqual(self.test_workflow_template_transition.label, test_workflow_template_transition_label)
    events = self._get_test_events()
    self.assertEqual(events.count(), 1)
    self.assertEqual(events[0].action_object, self.test_workflow_template_transition)
    self.assertEqual(events[0].actor, self._test_case_user)
    self.assertEqual(events[0].target, self.test_workflow_template)
    self.assertEqual(events[0].verb, event_workflow_template_edited.id)
def test_workflow_template_transition_edit_view_with_access(self):
    self._create_test_workflow_template_transition()
    test_workflow_template_transition_label = self.test_workflow_template_transition.label
    self.grant_access(obj=self.test_workflow_template, permission=permission_workflow_template_edit)
    self._clear_events()
    response = self._request_test_workflow_template_transition_edit_view()
    self.assertEqual(response.status_code, 302)
    self.test_workflow_template_transition.refresh_from_db()
    self.assertNotEqual(self.test_workflow_template_transition.label, test_workflow_template_transition_label)
    events = self._get_test_events()
    self.assertEqual(events.count(), 1)
    self.assertEqual(events[0].action_object, self.test_workflow_template_transition)
    self.assertEqual(events[0].actor, self._test_case_user)
    self.assertEqual(events[0].target, self.test_workflow_template)
    self.assertEqual(events[0].verb, event_workflow_template_edited.id)