From 5880a650b3c9879d295cb87d5af8166aedec76e9 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 14 Sep 2018 00:18:02 -0400 Subject: [PATCH] document_indexing: Test for an empty node list instead of a non existing root node. Signed-off-by: Roberto Rosario --- mayan/apps/document_indexing/tests/test_views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mayan/apps/document_indexing/tests/test_views.py b/mayan/apps/document_indexing/tests/test_views.py index 3c54785005..5d2b2d3322 100644 --- a/mayan/apps/document_indexing/tests/test_views.py +++ b/mayan/apps/document_indexing/tests/test_views.py @@ -2,12 +2,12 @@ from __future__ import absolute_import, unicode_literals from documents.tests import GenericDocumentViewTestCase -from ..models import Index, IndexInstanceNode +from ..models import Index from ..permissions import ( permission_document_indexing_create, permission_document_indexing_delete, permission_document_indexing_edit, permission_document_indexing_instance_view, - permission_document_indexing_rebuild, permission_document_indexing_view + permission_document_indexing_rebuild ) from .literals import ( @@ -170,8 +170,9 @@ class IndexViewTestCase(GenericDocumentViewTestCase): # No error since we just don't see the index self.assertEqual(response.status_code, 200) - with self.assertRaises(IndexInstanceNode.DoesNotExist): - self.index.instance_root + self.assertEqual( + self.index.instance_root.get_children_count(), 0 + ) def test_index_rebuild_with_access(self): self._create_index(rebuild=False)