diff options
author | Joshua Kehn <josh@kehn.us> | 2015-09-04 15:58:15 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-09-05 09:20:57 -0400 |
commit | e687794f6b04566ec1bf6d19a620c165d61f3c79 (patch) | |
tree | fe7cfde0d567be3d7fe4168c1a3990b5751c1c98 /tests/csrf_tests/tests.py | |
parent | ab26b65b2f178597be845e203eb698e193e3502e (diff) | |
download | django-e687794f6b04566ec1bf6d19a620c165d61f3c79.tar.gz |
Cleaned up docstrings in csrf_tests/tests.py.
Diffstat (limited to 'tests/csrf_tests/tests.py')
-rw-r--r-- | tests/csrf_tests/tests.py | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/tests/csrf_tests/tests.py b/tests/csrf_tests/tests.py index aaa9a6969a..382242d6a4 100644 --- a/tests/csrf_tests/tests.py +++ b/tests/csrf_tests/tests.py @@ -90,8 +90,8 @@ class CsrfViewMiddlewareTest(SimpleTestCase): def test_process_view_token_too_long(self): """ - Check that if the token is longer than expected, it is ignored and - a new token is created. + If the token is longer than expected, it is ignored and a new token is + created. """ req = self._get_GET_no_csrf_cookie_request() req.COOKIES[settings.CSRF_COOKIE_NAME] = 'x' * 10000000 @@ -311,7 +311,7 @@ class CsrfViewMiddlewareTest(SimpleTestCase): @override_settings(ALLOWED_HOSTS=['www.example.com']) def test_https_malformed_referer(self): """ - Test that a POST HTTPS request with a bad referer is rejected + A POST HTTPS request with a bad referer is rejected. """ req = self._get_POST_request_with_token() req._is_secure_override = True @@ -329,7 +329,7 @@ class CsrfViewMiddlewareTest(SimpleTestCase): @override_settings(ALLOWED_HOSTS=['www.example.com']) def test_https_good_referer(self): """ - Test that a POST HTTPS request with a good referer is accepted + A POST HTTPS request with a good referer is accepted. """ req = self._get_POST_request_with_token() req._is_secure_override = True @@ -341,8 +341,8 @@ class CsrfViewMiddlewareTest(SimpleTestCase): @override_settings(ALLOWED_HOSTS=['www.example.com']) def test_https_good_referer_2(self): """ - Test that a POST HTTPS request with a good referer is accepted - where the referer contains no trailing slash + A POST HTTPS request with a good referer is accepted where the referer + contains no trailing slash. """ # See ticket #15617 req = self._get_POST_request_with_token() @@ -367,8 +367,7 @@ class CsrfViewMiddlewareTest(SimpleTestCase): def test_ensures_csrf_cookie_no_middleware(self): """ - Tests that ensures_csrf_cookie decorator fulfils its promise - with no middleware + The ensure_csrf_cookie() decorator works without middleware. """ @ensure_csrf_cookie def view(request): @@ -382,8 +381,8 @@ class CsrfViewMiddlewareTest(SimpleTestCase): def test_ensures_csrf_cookie_with_middleware(self): """ - Tests that ensures_csrf_cookie decorator fulfils its promise - with the middleware enabled. + The ensure_csrf_cookie() decorator works with the CsrfViewMiddleware + enabled. """ @ensure_csrf_cookie def view(request): @@ -399,7 +398,7 @@ class CsrfViewMiddlewareTest(SimpleTestCase): def test_ensures_csrf_cookie_no_logging(self): """ - Tests that ensure_csrf_cookie doesn't log warnings. See #19436. + ensure_csrf_cookie() doesn't log warnings (#19436). """ @ensure_csrf_cookie def view(request): @@ -425,8 +424,7 @@ class CsrfViewMiddlewareTest(SimpleTestCase): def test_csrf_cookie_age(self): """ - Test to verify CSRF cookie age can be set using - settings.CSRF_COOKIE_AGE. + CSRF cookie age can be set using settings.CSRF_COOKIE_AGE. """ req = self._get_GET_no_csrf_cookie_request() @@ -447,8 +445,8 @@ class CsrfViewMiddlewareTest(SimpleTestCase): def test_csrf_cookie_age_none(self): """ - Test to verify CSRF cookie age does not have max age set and therefore - uses session-based cookies. + CSRF cookie age does not have max age set and therefore uses + session-based cookies. """ req = self._get_GET_no_csrf_cookie_request() |