Improve rendering of documents with no pages.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
14
mayan/apps/documents/tests/test_widgets.py
Normal file
14
mayan/apps/documents/tests/test_widgets.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from ..widgets import DocumentThumbnailWidget
|
||||
|
||||
from .test_models import GenericDocumentTestCase
|
||||
|
||||
|
||||
class DocumentWidgetTestCase(GenericDocumentTestCase):
|
||||
def test_document_list_view_document_with_no_pages(self):
|
||||
document_thumbnail_widget = DocumentThumbnailWidget()
|
||||
self.document.pages.all().delete()
|
||||
result = document_thumbnail_widget.render(instance=self.document)
|
||||
|
||||
self.assertTrue(self.document.get_absolute_url() in result)
|
||||
Reference in New Issue
Block a user