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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user