From 4bb70cbcc60794f515c9bfefeca87b8272d33c0c Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 10 Nov 2016 15:16:11 -0500 Subject: [PATCH] Removed an obsolete (as of refs #25999) logging test from refs #18985. --- tests/logging_tests/tests.py | 31 ------------------------------- 1 file changed, 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)