Permalink
Browse files

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.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@13735 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 5912903 commit 568b9cdf374e8c0261bc6d774cb912ad48076072 @spookylukey spookylukey committed Sep 10, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 tests/regressiontests/csrf_tests/tests.py
View
7 tests/regressiontests/csrf_tests/tests.py
@@ -207,8 +207,11 @@ def test_process_response_exempt_view(self):
"""
Check that no post processing is done for an exempt view
"""
- req = self._get_POST_csrf_cookie_request()
- resp = csrf_exempt(post_form_view)(req)
+ req = self._get_GET_csrf_cookie_request()
+ view = csrf_exempt(post_form_view)
+ CsrfMiddleware().process_view(req, view, (), {})
+
+ resp = view(req)
resp_content = resp.content
resp2 = CsrfMiddleware().process_response(req, resp)
self.assertEquals(resp_content, resp2.content)

0 comments on commit 568b9cd

Please sign in to comment.