0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Added test about error filterwarnings

Refs #20083.
This commit is contained in:
Claude Paroz 2014-03-08 11:51:08 +01:00
parent 0c6a339952
commit 8446a2438f

View File

@ -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):