diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2010-09-10 23:58:52 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2010-09-10 23:58:52 +0000 |
| commit | 260eff568423fca4af6456290a8c17a265a04038 (patch) | |
| tree | 4b8430a08923fb193ad8937aa8dc644be1546547 | |
| parent | 890b0b6234f3ae742a9cb97f27fe0bb7d900b93b (diff) | |
[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.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13736 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | tests/regressiontests/csrf_tests/tests.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/regressiontests/csrf_tests/tests.py b/tests/regressiontests/csrf_tests/tests.py index 8fbc7669a5..9030d397ab 100644 --- a/tests/regressiontests/csrf_tests/tests.py +++ b/tests/regressiontests/csrf_tests/tests.py @@ -207,8 +207,11 @@ class CsrfMiddlewareTest(TestCase): """ 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) |
