Skip to content

Commit

Permalink
Refs #17323 -- Updated a test to use try/finally to avoid state leaka…
Browse files Browse the repository at this point in the history
…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
carljm committed Dec 16, 2011
1 parent 3f003a3 commit 1b312ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/regressiontests/requests/tests.py
Expand Up @@ -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)

0 comments on commit 1b312ed

Please sign in to comment.