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
This commit is contained in:
Luke Plant 2010-09-10 23:56:10 +00:00
parent 5912903852
commit 568b9cdf37
1 changed files with 5 additions and 2 deletions

View File

@ -207,8 +207,11 @@ class CsrfMiddlewareTest(TestCase):
""" """
Check that no post processing is done for an exempt view Check that no post processing is done for an exempt view
""" """
req = self._get_POST_csrf_cookie_request() req = self._get_GET_csrf_cookie_request()
resp = csrf_exempt(post_form_view)(req) view = csrf_exempt(post_form_view)
CsrfMiddleware().process_view(req, view, (), {})
resp = view(req)
resp_content = resp.content resp_content = resp.content
resp2 = CsrfMiddleware().process_response(req, resp) resp2 = CsrfMiddleware().process_response(req, resp)
self.assertEquals(resp_content, resp2.content) self.assertEquals(resp_content, resp2.content)