diff options
author | Tim Graham <timograham@gmail.com> | 2016-11-10 15:16:11 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2016-11-10 15:16:11 -0500 |
commit | 4bb70cbcc60794f515c9bfefeca87b8272d33c0c (patch) | |
tree | 5fd7136719731d7e78a0894e74c30925c21a5a76 | |
parent | 8858631498bca33feb2acde71f9cf6ca2884b1bd (diff) | |
download | django-4bb70cbcc60794f515c9bfefeca87b8272d33c0c.tar.gz |
Removed an obsolete (as of refs #25999) logging test from refs #18985.
-rw-r--r-- | tests/logging_tests/tests.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/logging_tests/tests.py b/tests/logging_tests/tests.py index ca141657c8..5a65c88497 100644 --- a/tests/logging_tests/tests.py +++ b/tests/logging_tests/tests.py @@ -2,7 +2,6 @@ from __future__ import unicode_literals import logging -import warnings from contextlib import contextmanager from admin_scripts.tests import AdminScriptTestCase @@ -15,7 +14,6 @@ from django.db import connection from django.test import RequestFactory, SimpleTestCase, override_settings from django.test.utils import LoggingCaptureMixin, patch_logger from django.utils import six -from django.utils.deprecation import RemovedInNextVersionWarning from django.utils.log import ( DEFAULT_LOGGING, AdminEmailHandler, CallbackFilter, RequireDebugFalse, RequireDebugTrue, ServerFormatter, @@ -147,35 +145,6 @@ class I18nLoggingTests(SetupDefaultLoggingMixin, LoggingCaptureMixin, SimpleTest self.assertEqual(self.logger_output.getvalue(), 'Not Found: /this_does_not/\nNot Found: /en/nor_this/\n') -class WarningLoggerTests(SimpleTestCase): - """ - Tests that warnings output for RemovedInDjangoXXWarning (XX being the next - Django version) is enabled and captured to the logging system - """ - def setUp(self): - # If tests are invoke with "-Wall" (or any -W flag actually) then - # warning logging gets disabled (see configure_logging in django/utils/log.py). - # However, these tests expect warnings to be logged, so manually force warnings - # to the logs. Use getattr() here because the logging capture state is - # undocumented and (I assume) brittle. - self._old_capture_state = bool(getattr(logging, '_warnings_showwarning', False)) - logging.captureWarnings(True) - - def tearDown(self): - # Reset warnings state. - logging.captureWarnings(self._old_capture_state) - - @override_settings(DEBUG=True) - def test_error_filter_still_raises(self): - with warnings.catch_warnings(): - warnings.filterwarnings( - 'error', - category=RemovedInNextVersionWarning - ) - with self.assertRaises(RemovedInNextVersionWarning): - warnings.warn('Foo Deprecated', RemovedInNextVersionWarning) - - class CallbackFilterTest(SimpleTestCase): def test_sense(self): f_false = CallbackFilter(lambda r: False) |