summaryrefslogtreecommitdiff
path: root/tests/logging_tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-03-08 11:51:08 +0100
committerClaude Paroz <claude@2xlibre.net>2014-03-08 11:51:49 +0100
commit8446a2438ffeab845e31cba4489f03fccc387298 (patch)
tree962c4ce7a78c81cf5742d124b4a6f6ebcae36e07 /tests/logging_tests
parent0c6a3399523d850cfbd20de54cd089419a47383d (diff)
downloaddjango-8446a2438ffeab845e31cba4489f03fccc387298.tar.gz
Added test about error filterwarnings
Refs #20083.
Diffstat (limited to 'tests/logging_tests')
-rw-r--r--tests/logging_tests/tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/logging_tests/tests.py b/tests/logging_tests/tests.py
index 8aff4ec6c4..34ed24dc6a 100644
--- a/tests/logging_tests/tests.py
+++ b/tests/logging_tests/tests.py
@@ -128,6 +128,16 @@ class WarningLoggerTests(TestCase):
output = force_text(self.outputs[0].getvalue())
self.assertFalse('Foo Deprecated' in output)
+ @override_settings(DEBUG=True)
+ def test_error_filter_still_raises(self):
+ with warnings.catch_warnings():
+ warnings.filterwarnings(
+ 'error',
+ category=RemovedInNextVersionWarning
+ )
+ with self.assertRaises(RemovedInNextVersionWarning):
+ warnings.warn('Foo Deprecated', RemovedInNextVersionWarning)
+
class CallbackFilterTest(TestCase):
def test_sense(self):