Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cleaned up some test code.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15957 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4a6cb387228eabd746584e34dfe07b888fdb2813 1 parent 16f6acd
Luke Plant authored March 30, 2011
11  tests/regressiontests/csrf_tests/tests.py
@@ -21,17 +21,12 @@ def post_form_view(request):
21 21
     return post_form_response()
22 22
 
23 23
 # Response/views used for template tag tests
24  
-def _token_template():
25  
-    return Template("{% csrf_token %}")
26  
-
27  
-def _render_csrf_token_template(req):
28  
-    context = RequestContext(req, processors=[csrf])
29  
-    template = _token_template()
30  
-    return template.render(context)
31 24
 
32 25
 def token_view(request):
33 26
     """A view that uses {% csrf_token %}"""
34  
-    return HttpResponse(_render_csrf_token_template(request))
  27
+    context = RequestContext(request, processors=[csrf])
  28
+    template = Template("{% csrf_token %}")
  29
+    return HttpResponse(template.render(context))
35 30
 
36 31
 def non_token_view_using_request_processor(request):
37 32
     """

0 notes on commit 4a6cb38

Please sign in to comment.
Something went wrong with that request. Please try again.