mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #14508 - test suite silences warnings.
Utility functions get_warnings_state and save_warnings_state have been added to django.test.utils, and methods to django.test.TestCase for convenience. The implementation is based on the catch_warnings context manager from Python 2.6. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14526 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -48,14 +48,14 @@ class AuthContextProcessorTests(TestCase):
|
||||
fixtures = ['context-processors-users.xml']
|
||||
|
||||
def setUp(self):
|
||||
self.save_warnings_state()
|
||||
warnings.filterwarnings('ignore', category=DeprecationWarning,
|
||||
module='django.contrib.auth.models')
|
||||
warnings.filterwarnings('ignore', category=DeprecationWarning,
|
||||
module='django.core.context_processors')
|
||||
|
||||
def tearDown(self):
|
||||
warnings.resetwarnings()
|
||||
warnings.simplefilter('ignore', PendingDeprecationWarning)
|
||||
self.restore_warnings_state()
|
||||
|
||||
def test_session_not_accessed(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user