summaryrefslogtreecommitdiff
path: root/tests/admin_scripts/tests.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-12-21 21:19:05 +0100
committerClaude Paroz <claude@2xlibre.net>2014-12-30 18:16:25 +0100
commit51890ce8898f821d28f2f6fb6071c936e9bd88f0 (patch)
tree6522c597d411086b0a5c2ec3dd7a1d9bc2feeafd /tests/admin_scripts/tests.py
parent66f9a74b4514bd259976ce8ee3a4e78288358a5f (diff)
Applied ignore_warnings to Django tests
Diffstat (limited to 'tests/admin_scripts/tests.py')
-rw-r--r--tests/admin_scripts/tests.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 086e5365a1..c0c14d5bc5 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -15,17 +15,17 @@ import socket
import subprocess
import sys
import unittest
-import warnings
import django
from django import conf, get_version
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management import BaseCommand, CommandError, call_command, color
+from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.encoding import force_text
from django.utils._os import npath, upath
from django.utils.six import StringIO
-from django.test import LiveServerTestCase, TestCase, mock, override_settings
+from django.test import LiveServerTestCase, TestCase, ignore_warnings, mock, override_settings
from django.test.runner import DiscoverRunner
@@ -1663,11 +1663,10 @@ class CommandTypes(AdminScriptTestCase):
self.assertOutput(out, "EXECUTE:LabelCommand label=testlabel, options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', False), ('verbosity', 1)]")
self.assertOutput(out, "EXECUTE:LabelCommand label=anotherlabel, options=[('no_color', False), ('pythonpath', None), ('settings', None), ('traceback', False), ('verbosity', 1)]")
+ @ignore_warnings(category=RemovedInDjango19Warning)
def test_requires_model_validation_and_requires_system_checks_both_defined(self):
- 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)
+ from .management.commands.validation_command import InvalidCommand
+ self.assertRaises(ImproperlyConfigured, InvalidCommand)
class Discovery(TestCase):