From 53aa6c6ac1b6534f2e3a159014401b84bf1f70c1 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 20 Jan 2014 20:30:29 +0800 Subject: Added warning silencers to some noisy tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These warnings all emerged as the result of the introduction of the checks framework. Thanks to Anssi Kääriäinen for the report. --- tests/admin_scripts/management/commands/color_command.py | 2 +- tests/admin_scripts/tests.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/admin_scripts') diff --git a/tests/admin_scripts/management/commands/color_command.py b/tests/admin_scripts/management/commands/color_command.py index 02da0a14ab..dda2cc826d 100644 --- a/tests/admin_scripts/management/commands/color_command.py +++ b/tests/admin_scripts/management/commands/color_command.py @@ -3,7 +3,7 @@ from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): help = "Test color output" - requires_model_validation = False + requires_system_checks = False def handle_noargs(self, **options): return self.style.SQL_KEYWORD('BEGIN') diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 0d7ce41dcb..225441827f 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -6,7 +6,6 @@ A series of tests to establish that the command-line managment tools work as advertised - especially with regards to the handling of the DJANGO_SETTINGS_MODULE and default settings.py files. """ -from __future__ import unicode_literals import codecs import os @@ -16,6 +15,7 @@ import socket import subprocess import sys import unittest +import warnings import django from django import conf, get_version @@ -1556,8 +1556,10 @@ class CommandTypes(AdminScriptTestCase): self.assertOutput(out, str_prefix("EXECUTE:LabelCommand label=anotherlabel, options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', None), ('verbosity', %(_)s'1')]")) def test_requires_model_validation_and_requires_system_checks_both_defined(self): - from .management.commands.validation_command import InvalidCommand - self.assertRaises(ImproperlyConfigured, InvalidCommand) + with warnings.catch_warnings(record=True): + warnings.filterwarnings('ignore', module='django.core.management.base') + from .management.commands.validation_command import InvalidCommand + self.assertRaises(ImproperlyConfigured, InvalidCommand) class Discovery(TestCase): -- cgit v1.3