Commits

Luke Plant committed 6c17d13

[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.

Comments (0)

Files changed (1)

tests/regressiontests/csrf_tests/tests.py

         """
         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)