summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2011-03-30 17:35:50 +0000
committerLuke Plant <L.Plant.98@cantab.net>2011-03-30 17:35:50 +0000
commit4a6cb387228eabd746584e34dfe07b888fdb2813 (patch)
treeba610f7a981ddcc37c8e85c7d0a72ed8e3a6688b /tests
parent16f6acdb89c42efaa99b81989a9fae01ff8e607d (diff)
Cleaned up some test code.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15957 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/csrf_tests/tests.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/regressiontests/csrf_tests/tests.py b/tests/regressiontests/csrf_tests/tests.py
index 22cebcf547..990f7ae762 100644
--- a/tests/regressiontests/csrf_tests/tests.py
+++ b/tests/regressiontests/csrf_tests/tests.py
@@ -21,17 +21,12 @@ def post_form_view(request):
return post_form_response()
# Response/views used for template tag tests
-def _token_template():
- return Template("{% csrf_token %}")
-
-def _render_csrf_token_template(req):
- context = RequestContext(req, processors=[csrf])
- template = _token_template()
- return template.render(context)
def token_view(request):
"""A view that uses {% csrf_token %}"""
- return HttpResponse(_render_csrf_token_template(request))
+ context = RequestContext(request, processors=[csrf])
+ template = Template("{% csrf_token %}")
+ return HttpResponse(template.render(context))
def non_token_view_using_request_processor(request):
"""