Fix failing tests
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -46,7 +46,7 @@ class CabinetWorkflowActionViewTestCase(
|
||||
self._create_test_workflow_state()
|
||||
|
||||
response = self.get(
|
||||
viewname='document_states:setup_workflow_state_action_create',
|
||||
viewname='document_states:workflow_template_state_action_create',
|
||||
kwargs={
|
||||
'pk': self.test_workflow_state.pk,
|
||||
'class_path': 'mayan.apps.cabinets.workflow_actions.CabinetAddAction'
|
||||
@@ -61,7 +61,7 @@ class CabinetWorkflowActionViewTestCase(
|
||||
self._create_test_cabinet()
|
||||
|
||||
response = self.get(
|
||||
viewname='document_states:setup_workflow_state_action_create',
|
||||
viewname='document_states:workflow_template_state_action_create',
|
||||
kwargs={
|
||||
'pk': self.test_workflow_state.pk,
|
||||
'class_path': 'mayan.apps.cabinets.workflow_actions.CabinetRemoveAction'
|
||||
|
||||
@@ -79,41 +79,6 @@ class IndexViewTestCase(
|
||||
self.test_index.refresh_from_db()
|
||||
self.assertEqual(self.test_index.label, TEST_INDEX_LABEL_EDITED)
|
||||
|
||||
def test_index_rebuild_view_no_permission(self):
|
||||
self.upload_document()
|
||||
self._create_test_index()
|
||||
|
||||
self.test_index.node_templates.create(
|
||||
parent=self.test_index.template_root,
|
||||
expression=TEST_INDEX_TEMPLATE_DOCUMENT_LABEL_EXPRESSION,
|
||||
link_documents=True
|
||||
)
|
||||
|
||||
response = self._request_test_index_rebuild_view()
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
self.assertEqual(IndexInstanceNode.objects.count(), 0)
|
||||
|
||||
def test_index_rebuild_view_with_access(self):
|
||||
self.upload_document()
|
||||
self._create_test_index()
|
||||
|
||||
self.test_index.node_templates.create(
|
||||
parent=self.test_index.template_root,
|
||||
expression=TEST_INDEX_TEMPLATE_DOCUMENT_LABEL_EXPRESSION,
|
||||
link_documents=True
|
||||
)
|
||||
|
||||
self.grant_access(
|
||||
obj=self.test_index,
|
||||
permission=permission_document_indexing_rebuild
|
||||
)
|
||||
|
||||
response = self._request_test_index_rebuild_view()
|
||||
self.assertEqual(response.status_code, 302)
|
||||
|
||||
self.assertNotEqual(IndexInstanceNode.objects.count(), 0)
|
||||
|
||||
|
||||
class IndexInstaceViewTestMixin(object):
|
||||
def _create_index_template_node(self):
|
||||
|
||||
@@ -163,7 +163,7 @@ class DocumentAPIViewTestMixin(object):
|
||||
)
|
||||
|
||||
def _request_test_document_api_upload_view(self):
|
||||
with open(TEST_DOCUMENT_PATH, mode='rb') as file_descriptor:
|
||||
with open(TEST_DOCUMENT_PATH, mode='rb') as file_object:
|
||||
return self.post(
|
||||
viewname='rest_api:document-list', data={
|
||||
'document_type': self.test_document_type.pk,
|
||||
|
||||
Reference in New Issue
Block a user