Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refs #17323 -- Updated a test to use try/finally to avoid state leaka…

…ge. Thanks dstufft for the patch.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1b312edbeb469c58d8518cc0ece9cdb6c37f5c7e 1 parent 3f003a3
@carljm carljm authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 tests/regressiontests/requests/
6 tests/regressiontests/requests/
@@ -426,5 +426,7 @@ def test_raw_post_data_returns_body(self):
warnings_state = get_warnings_state()
warnings.filterwarnings('ignore', category=DeprecationWarning, module='django.http')
- self.assertEqual(request.body, request.raw_post_data)
- restore_warnings_state(warnings_state)
+ try:
+ self.assertEqual(request.body, request.raw_post_data)
+ finally:
+ restore_warnings_state(warnings_state)
Please sign in to comment.
Something went wrong with that request. Please try again.