diff options
author | Jason Myers <jason@jasonamyers.com> | 2013-11-02 23:36:09 -0500 |
---|---|---|
committer | Jason Myers <jason@jasonamyers.com> | 2013-11-02 23:50:49 -0500 |
commit | 7a61c68c50d3837c50e35c252fd76220f08b5290 (patch) | |
tree | 586f16a3f02c2b45ffb3dd2af834c0ef604e099c /tests/csrf_tests/tests.py | |
parent | 0fdb692c6c94d912f17a3e2ad12413fb072d38ec (diff) | |
download | django-7a61c68c50d3837c50e35c252fd76220f08b5290.tar.gz |
PEP8 cleanup
Signed-off-by: Jason Myers <jason@jasonamyers.com>
Diffstat (limited to 'tests/csrf_tests/tests.py')
-rw-r--r-- | tests/csrf_tests/tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/csrf_tests/tests.py b/tests/csrf_tests/tests.py index 57f8359cc7..ac48c17af6 100644 --- a/tests/csrf_tests/tests.py +++ b/tests/csrf_tests/tests.py @@ -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. |