diff options
| author | Aymeric Augustin <aymeric.augustin@polyconseil.fr> | 2012-05-03 15:27:01 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@polyconseil.fr> | 2012-05-03 15:27:01 +0200 |
| commit | e84f79f05113f546810c1908c7baef99fb1e874a (patch) | |
| tree | 4cb5f3e428caa894bd9acc06fc3cd6250b018715 /tests/regressiontests/logging_tests | |
| parent | 227cec686e512412f613c3d14743b85445765d92 (diff) | |
Fixed #18042 -- Advanced deprecation warnings.
Thanks Ramiro for the patch.
Diffstat (limited to 'tests/regressiontests/logging_tests')
| -rw-r--r-- | tests/regressiontests/logging_tests/tests.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/regressiontests/logging_tests/tests.py b/tests/regressiontests/logging_tests/tests.py index 5563ea6b4f..6ec7f2a645 100644 --- a/tests/regressiontests/logging_tests/tests.py +++ b/tests/regressiontests/logging_tests/tests.py @@ -1,9 +1,10 @@ import copy +import warnings from django.conf import compat_patch_logging_config from django.core import mail from django.test import TestCase, RequestFactory -from django.test.utils import override_settings +from django.test.utils import override_settings, get_warnings_state, restore_warnings_state from django.utils.log import CallbackFilter, RequireDebugFalse, getLogger @@ -40,7 +41,13 @@ class PatchLoggingConfigTest(TestCase): """ config = copy.deepcopy(OLD_LOGGING) - compat_patch_logging_config(config) + + warnings_state = get_warnings_state() + warnings.filterwarnings('ignore', category=DeprecationWarning, module='django.conf') + try: + compat_patch_logging_config(config) + finally: + restore_warnings_state(warnings_state) self.assertEqual( config["handlers"]["mail_admins"]["filters"], |
