mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
Removed warnings level handling code as per deprecation TL.
This commit is contained in:
@@ -162,10 +162,6 @@ class SimpleTestCase(ut2.TestCase):
|
||||
# Can be overridden in derived classes.
|
||||
client_class = Client
|
||||
|
||||
_warn_txt = ("save_warnings_state/restore_warnings_state "
|
||||
"django.test.*TestCase methods are deprecated. Use Python's "
|
||||
"warnings.catch_warnings context manager instead.")
|
||||
|
||||
def __call__(self, result=None):
|
||||
"""
|
||||
Wrapper around default __call__ method to perform common Django test
|
||||
@@ -225,21 +221,6 @@ class SimpleTestCase(ut2.TestCase):
|
||||
settings.ROOT_URLCONF = self._old_root_urlconf
|
||||
clear_url_caches()
|
||||
|
||||
def save_warnings_state(self):
|
||||
"""
|
||||
Saves the state of the warnings module
|
||||
"""
|
||||
warnings.warn(self._warn_txt, DeprecationWarning, stacklevel=2)
|
||||
self._warnings_state = warnings.filters[:]
|
||||
|
||||
def restore_warnings_state(self):
|
||||
"""
|
||||
Restores the state of the warnings module to the state
|
||||
saved by save_warnings_state()
|
||||
"""
|
||||
warnings.warn(self._warn_txt, DeprecationWarning, stacklevel=2)
|
||||
warnings.filters = self._warnings_state[:]
|
||||
|
||||
def settings(self, **kwargs):
|
||||
"""
|
||||
A context manager that temporarily sets a setting and reverts
|
||||
|
||||
Reference in New Issue
Block a user