diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2010-11-11 15:06:20 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2010-11-11 15:06:20 +0000 |
| commit | 02fc6276d7577dcec26be30f3805b242ff0ce8a0 (patch) | |
| tree | a85f54ee41330e4289169d7cac4ee04b55e22ba6 /tests/regressiontests/context_processors | |
| parent | 7beca4d3e5da784297ff7163d00dcfeee9a34dd6 (diff) | |
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
Diffstat (limited to 'tests/regressiontests/context_processors')
| -rw-r--r-- | tests/regressiontests/context_processors/tests.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/regressiontests/context_processors/tests.py b/tests/regressiontests/context_processors/tests.py index 2b5ddbe94c..5a89561bb6 100644 --- a/tests/regressiontests/context_processors/tests.py +++ b/tests/regressiontests/context_processors/tests.py @@ -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): """ |
