Tests: Silence expected debug output during tests

Several tests cause errors on purpose to test behaviors.
This commit mute these tests setting their debug level
to critical or by using a context manager to null their
stdout descriptor.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2018-12-07 16:06:53 -04:00
parent 28f387cf6c
commit 99a1d143ee
8 changed files with 46 additions and 14 deletions
+3 -1
View File
@@ -6,6 +6,7 @@ import time
from django.test import override_settings
from mayan.apps.common.tests import BaseTestCase
from mayan.apps.common.tests.utils import mute_stdout
from ..literals import STUB_EXPIRATION_INTERVAL
from ..models import (
@@ -27,7 +28,8 @@ from .mixins import DocumentTestMixin
class DocumentTestCase(DocumentTestMixin, BaseTestCase):
def test_natural_keys(self):
self.document.pages.first().generate_image()
self._test_database_conversion('documents')
with mute_stdout():
self._test_database_conversion('documents')
def test_document_creation(self):
self.assertEqual(self.document_type.label, TEST_DOCUMENT_TYPE_LABEL)