Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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: http://code.djangoproject.com/svn/django/trunk@17211 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/tests.py
View
6 tests/regressiontests/requests/tests.py
@@ -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.