mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
PEP8 cleanup
Signed-off-by: Jason Myers <jason@jasonamyers.com>
This commit is contained in:
parent
0fdb692c6c
commit
7a61c68c50
128 changed files with 739 additions and 206 deletions
|
@ -19,10 +19,12 @@ def post_form_response():
|
|||
""", mimetype="text/html")
|
||||
return resp
|
||||
|
||||
|
||||
def post_form_view(request):
|
||||
"""A view that returns a POST form (without a token)"""
|
||||
return post_form_response()
|
||||
|
||||
|
||||
# Response/views used for template tag tests
|
||||
|
||||
def token_view(request):
|
||||
|
@ -31,6 +33,7 @@ def token_view(request):
|
|||
template = Template("{% csrf_token %}")
|
||||
return HttpResponse(template.render(context))
|
||||
|
||||
|
||||
def non_token_view_using_request_processor(request):
|
||||
"""
|
||||
A view that doesn't use the token, but does use the csrf view processor.
|
||||
|
@ -39,6 +42,7 @@ def non_token_view_using_request_processor(request):
|
|||
template = Template("")
|
||||
return HttpResponse(template.render(context))
|
||||
|
||||
|
||||
class TestingHttpRequest(HttpRequest):
|
||||
"""
|
||||
A version of HttpRequest that allows us to change some things
|
||||
|
@ -47,6 +51,7 @@ class TestingHttpRequest(HttpRequest):
|
|||
def is_secure(self):
|
||||
return getattr(self, '_is_secure_override', False)
|
||||
|
||||
|
||||
class CsrfViewMiddlewareTest(TestCase):
|
||||
# The csrf token is potentially from an untrusted source, so could have
|
||||
# characters that need dealing with.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue