Tests: Mute database convertion tests output

Mute the root mixin to mute all the database conversion tests.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2018-12-07 21:16:07 -04:00
parent f744eb8871
commit 0c7f9f50af
2 changed files with 8 additions and 6 deletions

View File

@@ -19,6 +19,9 @@ from mayan.apps.user_management.tests import (
from ..settings import setting_temporary_directory
from .utils import mute_stdout
if getattr(settings, 'COMMON_TEST_FILE_HANDLES', False):
import psutil
@@ -49,9 +52,10 @@ class ContentTypeCheckMixin(object):
class DatabaseConversionMixin(object):
def _test_database_conversion(self, *app_labels):
management.call_command(
'convertdb', *app_labels, force=True
)
with mute_stdout():
management.call_command(
'convertdb', *app_labels, force=True
)
class OpenFileCheckMixin(object):

View File

@@ -6,7 +6,6 @@ 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 (
@@ -28,8 +27,7 @@ from .mixins import DocumentTestMixin
class DocumentTestCase(DocumentTestMixin, BaseTestCase):
def test_natural_keys(self):
self.document.pages.first().generate_image()
with mute_stdout():
self._test_database_conversion('documents')
self._test_database_conversion('documents')
def test_document_creation(self):
self.assertEqual(self.document_type.label, TEST_DOCUMENT_TYPE_LABEL)