Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] Fixed a test so that it actually tests what it's supposed to …

…test.

  
Previously it passed whether or not the view was 'csrf_exempt'ed.

Backport of [13735] from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13736 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 260eff568423fca4af6456290a8c17a265a04038 1 parent 890b0b6
Luke Plant authored September 10, 2010

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  tests/regressiontests/csrf_tests/tests.py
7  tests/regressiontests/csrf_tests/tests.py
@@ -207,8 +207,11 @@ def test_process_response_exempt_view(self):
207 207
         """
208 208
         Check that no post processing is done for an exempt view
209 209
         """
210  
-        req = self._get_POST_csrf_cookie_request()
211  
-        resp = csrf_exempt(post_form_view)(req)
  210
+        req = self._get_GET_csrf_cookie_request()
  211
+        view = csrf_exempt(post_form_view)
  212
+        CsrfMiddleware().process_view(req, view, (), {})
  213
+
  214
+        resp = view(req)
212 215
         resp_content = resp.content
213 216
         resp2 = CsrfMiddleware().process_response(req, resp)
214 217
         self.assertEquals(resp_content, resp2.content)

0 notes on commit 260eff5

Please sign in to comment.
Something went wrong with that request. Please try again.