summaryrefslogtreecommitdiff
path: root/tests/deprecation
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-03-02 14:37:30 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-03-09 11:07:21 +0100
commit06615d0d6e75b537291ea6be74a973a8b6160211 (patch)
tree791feba3bded2a603847813fbc82d5080db52791 /tests/deprecation
parent84c137490bad9043279278524bf958da8fb69fae (diff)
downloaddjango-06615d0d6e75b537291ea6be74a973a8b6160211.tar.gz
Avoided leaking warning filters.
Diffstat (limited to 'tests/deprecation')
-rw-r--r--tests/deprecation/tests.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/deprecation/tests.py b/tests/deprecation/tests.py
index 717f32344c..4d69963cfc 100644
--- a/tests/deprecation/tests.py
+++ b/tests/deprecation/tests.py
@@ -193,9 +193,8 @@ class DeprecatingRequestMergeDictTest(SimpleTestCase):
@override_settings(USE_I18N=True)
class DeprecatedChineseLanguageCodes(SimpleTestCase):
def test_deprecation_warning(self):
- warnings.simplefilter('always')
-
with warnings.catch_warnings(record=True) as recorded:
+ warnings.simplefilter('always')
with translation.override('zh-cn'):
pass
with translation.override('zh-tw'):
@@ -214,9 +213,8 @@ class DeprecatingMemoizeTest(SimpleTestCase):
"""
Ensure the correct warning is raised when memoize is used.
"""
- warnings.simplefilter('always')
-
with warnings.catch_warnings(record=True) as recorded:
+ warnings.simplefilter('always')
memoize(lambda x: x, {}, 1)
msg = str(recorded.pop().message)
self.assertEqual(msg,