summaryrefslogtreecommitdiff
path: root/tests/test_utils
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2013-06-28 13:10:34 -0300
committerRamiro Morales <cramm0@gmail.com>2013-06-28 21:48:15 -0300
commit4f6be9a0c43050500af598527e1453d27c5c5b85 (patch)
treed488ac20582cb83379b85d7ee56042a863e324a0 /tests/test_utils
parente1dd24d2f6dd3464ab50593320a7eb2325d6c196 (diff)
Removed warnings level handling code as per deprecation TL.
Diffstat (limited to 'tests/test_utils')
-rw-r--r--tests/test_utils/tests.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
index 5f7fb05eb4..b51ba7bf3b 100644
--- a/tests/test_utils/tests.py
+++ b/tests/test_utils/tests.py
@@ -270,37 +270,6 @@ class AssertTemplateUsedContextManagerTests(TestCase):
render_to_string('template_used/alternative.html')
-class SaveRestoreWarningState(TestCase):
- def test_save_restore_warnings_state(self):
- """
- Ensure save_warnings_state/restore_warnings_state work correctly.
- """
- # In reality this test could be satisfied by many broken implementations
- # of save_warnings_state/restore_warnings_state (e.g. just
- # warnings.resetwarnings()) , but it is difficult to test more.
- with warnings.catch_warnings():
- warnings.simplefilter("ignore", DeprecationWarning)
-
- self.save_warnings_state()
-
- class MyWarning(Warning):
- pass
-
- # Add a filter that causes an exception to be thrown, so we can catch it
- warnings.simplefilter("error", MyWarning)
- self.assertRaises(Warning, lambda: warnings.warn("warn", MyWarning))
-
- # Now restore.
- self.restore_warnings_state()
- # After restoring, we shouldn't get an exception. But we don't want a
- # warning printed either, so we have to silence the warning.
- warnings.simplefilter("ignore", MyWarning)
- warnings.warn("warn", MyWarning)
-
- # Remove the filter we just added.
- self.restore_warnings_state()
-
-
class HTMLEqualTests(TestCase):
def test_html_parser(self):
element = parse_html('<div><p>Hello</p></div>')