summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2014-01-20 20:30:29 +0800
committerRussell Keith-Magee <russell@keith-magee.com>2014-01-20 20:30:29 +0800
commit53aa6c6ac1b6534f2e3a159014401b84bf1f70c1 (patch)
tree22a21e76ad6bd1e429b8a1545d466b02fddab75c /tests/admin_scripts
parentb0602e935ca8f7fca4d43083a752a6a418bb1e71 (diff)
Added warning silencers to some noisy tests.
These warnings all emerged as the result of the introduction of the checks framework. Thanks to Anssi Kääriäinen for the report.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/management/commands/color_command.py2
-rw-r--r--tests/admin_scripts/tests.py8
2 files changed, 6 insertions, 4 deletions
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):