Author: lukeplant
Date: 2010-09-10 18:56:10 -0500 (Fri, 10 Sep 2010)
New Revision: 13735
Modified:
django/trunk/tests/regressiontests/csrf_tests/tests.py
Log:
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.
Modified: django/trunk/tests/regressiontests/csrf_tests/tests.py
===================================================================
--- django/trunk/tests/regressiontests/csrf_tests/tests.py 2010-09-10
23:30:46 UTC (rev 13734)
+++ django/trunk/tests/regressiontests/csrf_tests/tests.py 2010-09-10
23:56:10 UTC (rev 13735)
@@ -207,8 +207,11 @@
"""
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)
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.