Author: lukeplant
Date: 2010-09-10 18:58:52 -0500 (Fri, 10 Sep 2010)
New Revision: 13736
Modified:
django/branches/releases/1.2.X/
django/branches/releases/1.2.X/tests/regressiontests/csrf_tests/tests.py
Log:
[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.
Property changes on: django/branches/releases/1.2.X
___________________________________________________________________
Name: svnmerge-integrated
-
/django/trunk:1-13360,13400,13434,13480,13574,13600,13638,13652,13664,13666,13668,13680,13683,13685,13687-13688,13690,13694,13696,13701-13702,13705,13709,13712,13715,13717,13732
+
/django/trunk:1-13360,13400,13434,13480,13574,13600,13638,13652,13664,13666,13668,13680,13683,13685,13687-13688,13690,13694,13696,13701-13702,13705,13709,13712,13715,13717,13732,13735
Modified:
django/branches/releases/1.2.X/tests/regressiontests/csrf_tests/tests.py
===================================================================
--- django/branches/releases/1.2.X/tests/regressiontests/csrf_tests/tests.py
2010-09-10 23:56:10 UTC (rev 13735)
+++ django/branches/releases/1.2.X/tests/regressiontests/csrf_tests/tests.py
2010-09-10 23:58:52 UTC (rev 13736)
@@ -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.