diff options
| author | za <za@python.or.id> | 2016-10-27 14:53:39 +0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-11-10 21:30:21 -0500 |
| commit | 321e94fa41b121f65c02119c02098df327bbd569 (patch) | |
| tree | ce5476c191d589aca4b124f841dfbccac8dd299f /tests/view_tests | |
| parent | 4bb70cbcc60794f515c9bfefeca87b8272d33c0c (diff) | |
Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.
Diffstat (limited to 'tests/view_tests')
| -rw-r--r-- | tests/view_tests/tests/test_csrf.py | 4 | ||||
| -rw-r--r-- | tests/view_tests/tests/test_debug.py | 57 | ||||
| -rw-r--r-- | tests/view_tests/tests/test_defaults.py | 3 | ||||
| -rw-r--r-- | tests/view_tests/tests/test_specials.py | 5 | ||||
| -rw-r--r-- | tests/view_tests/tests/test_static.py | 3 | ||||
| -rw-r--r-- | tests/view_tests/views.py | 3 |
6 files changed, 31 insertions, 44 deletions
diff --git a/tests/view_tests/tests/test_csrf.py b/tests/view_tests/tests/test_csrf.py index fdd9715476..23dab04cd6 100644 --- a/tests/view_tests/tests/test_csrf.py +++ b/tests/view_tests/tests/test_csrf.py @@ -25,7 +25,7 @@ class CsrfViewTests(SimpleTestCase): ) def test_translation(self): """ - Test that an invalid request is rejected with a localized error message. + An invalid request is rejected with a localized error message. """ response = self.client.post('/') self.assertContains(response, "Forbidden", status_code=403) @@ -52,7 +52,7 @@ class CsrfViewTests(SimpleTestCase): ) def test_translation_middleware_classes(self): """ - Test that an invalid request is rejected with a localized error message. + An invalid request is rejected with a localized error message. """ response = self.client.post('/') self.assertContains(response, "Forbidden", status_code=403) diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index 2f6f164b24..3fe89d9bf3 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -80,7 +80,7 @@ class DebugViewTests(LoggingCaptureMixin, SimpleTestCase): self.assertNotContains(response, 'haha', status_code=500) def test_400(self): - # Ensure that when DEBUG=True, technical_500_template() is called. + # When DEBUG=True, technical_500_template() is called. response = self.client.get('/raises400/') self.assertContains(response, '<div class="context" id="', status_code=400) @@ -325,7 +325,7 @@ class ExceptionReporterTests(SimpleTestCase): self.assertIn('<p>Request data not supplied</p>', html) def test_eol_support(self): - """Test that the ExceptionReporter supports Unix, Windows and Macintosh EOL markers""" + """The ExceptionReporter supports Unix, Windows and Macintosh EOL markers""" LINES = list('print %d' % i for i in range(1, 6)) reporter = ExceptionReporter(None, None, None, None) @@ -789,14 +789,13 @@ class ExceptionReportTestMixin(object): @override_settings(ROOT_URLCONF='view_tests.urls') class ExceptionReporterFilterTests(ExceptionReportTestMixin, LoggingCaptureMixin, SimpleTestCase): """ - Ensure that sensitive information can be filtered out of error reports. - Refs #14614. + Sensitive information can be filtered out of error reports (#14614). """ rf = RequestFactory() def test_non_sensitive_request(self): """ - Ensure that everything (request info and frame variables) can bee seen + Everything (request info and frame variables) can bee seen in the default error reports for non-sensitive requests. """ with self.settings(DEBUG=True): @@ -809,7 +808,7 @@ class ExceptionReporterFilterTests(ExceptionReportTestMixin, LoggingCaptureMixin def test_sensitive_request(self): """ - Ensure that sensitive POST parameters and frame variables cannot be + Sensitive POST parameters and frame variables cannot be seen in the default error reports for sensitive requests. """ with self.settings(DEBUG=True): @@ -822,7 +821,7 @@ class ExceptionReporterFilterTests(ExceptionReportTestMixin, LoggingCaptureMixin def test_paranoid_request(self): """ - Ensure that no POST parameters and frame variables can be seen in the + No POST parameters and frame variables can be seen in the default error reports for "paranoid" requests. """ with self.settings(DEBUG=True): @@ -835,7 +834,7 @@ class ExceptionReporterFilterTests(ExceptionReportTestMixin, LoggingCaptureMixin def test_multivalue_dict_key_error(self): """ - #21098 -- Ensure that sensitive POST parameters cannot be seen in the + #21098 -- Sensitive POST parameters cannot be seen in the error reports for if request.POST['nonexistent_key'] throws an error. """ with self.settings(DEBUG=True): @@ -848,7 +847,7 @@ class ExceptionReporterFilterTests(ExceptionReportTestMixin, LoggingCaptureMixin def test_custom_exception_reporter_filter(self): """ - Ensure that it's possible to assign an exception reporter filter to + It's possible to assign an exception reporter filter to the request to bypass the one set in DEFAULT_EXCEPTION_REPORTER_FILTER. """ with self.settings(DEBUG=True): @@ -861,28 +860,21 @@ class ExceptionReporterFilterTests(ExceptionReportTestMixin, LoggingCaptureMixin def test_sensitive_method(self): """ - Ensure that the sensitive_variables decorator works with object - methods. - Refs #18379. + The sensitive_variables decorator works with object methods. """ with self.settings(DEBUG=True): - self.verify_unsafe_response(sensitive_method_view, - check_for_POST_params=False) - self.verify_unsafe_email(sensitive_method_view, - check_for_POST_params=False) + self.verify_unsafe_response(sensitive_method_view, check_for_POST_params=False) + self.verify_unsafe_email(sensitive_method_view, check_for_POST_params=False) with self.settings(DEBUG=False): - self.verify_safe_response(sensitive_method_view, - check_for_POST_params=False) - self.verify_safe_email(sensitive_method_view, - check_for_POST_params=False) + self.verify_safe_response(sensitive_method_view, check_for_POST_params=False) + self.verify_safe_email(sensitive_method_view, check_for_POST_params=False) def test_sensitive_function_arguments(self): """ - Ensure that sensitive variables don't leak in the sensitive_variables - decorator's frame, when those variables are passed as arguments to the - decorated function. - Refs #19453. + Sensitive variables don't leak in the sensitive_variables decorator's + frame, when those variables are passed as arguments to the decorated + function. """ with self.settings(DEBUG=True): self.verify_unsafe_response(sensitive_args_function_caller) @@ -894,10 +886,9 @@ class ExceptionReporterFilterTests(ExceptionReportTestMixin, LoggingCaptureMixin def test_sensitive_function_keyword_arguments(self): """ - Ensure that sensitive variables don't leak in the sensitive_variables - decorator's frame, when those variables are passed as keyword arguments - to the decorated function. - Refs #19453. + Sensitive variables don't leak in the sensitive_variables decorator's + frame, when those variables are passed as keyword arguments to the + decorated function. """ with self.settings(DEBUG=True): self.verify_unsafe_response(sensitive_kwargs_function_caller) @@ -980,7 +971,7 @@ class ExceptionReporterFilterTests(ExceptionReportTestMixin, LoggingCaptureMixin class AjaxResponseExceptionReporterFilter(ExceptionReportTestMixin, LoggingCaptureMixin, SimpleTestCase): """ - Ensure that sensitive information can be filtered out of error reports. + Sensitive information can be filtered out of error reports. Here we specifically test the plain text 500 debug-only error page served when it has been detected the request was sent by JS code. We don't check @@ -992,7 +983,7 @@ class AjaxResponseExceptionReporterFilter(ExceptionReportTestMixin, LoggingCaptu def test_non_sensitive_request(self): """ - Ensure that request info can bee seen in the default error reports for + Request info can bee seen in the default error reports for non-sensitive requests. """ with self.settings(DEBUG=True): @@ -1003,7 +994,7 @@ class AjaxResponseExceptionReporterFilter(ExceptionReportTestMixin, LoggingCaptu def test_sensitive_request(self): """ - Ensure that sensitive POST parameters cannot be seen in the default + Sensitive POST parameters cannot be seen in the default error reports for sensitive requests. """ with self.settings(DEBUG=True): @@ -1014,7 +1005,7 @@ class AjaxResponseExceptionReporterFilter(ExceptionReportTestMixin, LoggingCaptu def test_paranoid_request(self): """ - Ensure that no POST parameters can be seen in the default error reports + No POST parameters can be seen in the default error reports for "paranoid" requests. """ with self.settings(DEBUG=True): @@ -1025,7 +1016,7 @@ class AjaxResponseExceptionReporterFilter(ExceptionReportTestMixin, LoggingCaptu def test_custom_exception_reporter_filter(self): """ - Ensure that it's possible to assign an exception reporter filter to + It's possible to assign an exception reporter filter to the request to bypass the one set in DEFAULT_EXCEPTION_REPORTER_FILTER. """ with self.settings(DEBUG=True): diff --git a/tests/view_tests/tests/test_defaults.py b/tests/view_tests/tests/test_defaults.py index 135b8d2c9a..1b5ad25102 100644 --- a/tests/view_tests/tests/test_defaults.py +++ b/tests/view_tests/tests/test_defaults.py @@ -86,8 +86,7 @@ class DefaultsTests(TestCase): }]) def test_custom_templates(self): """ - Test that 404.html and 500.html templates are picked by their respective - handler. + 404.html and 500.html templates are picked by their respective handler. """ response = self.client.get('/server_error/') self.assertContains(response, "test template for a 500 error", status_code=500) diff --git a/tests/view_tests/tests/test_specials.py b/tests/view_tests/tests/test_specials.py index 59428f9a8f..8ef766e86f 100644 --- a/tests/view_tests/tests/test_specials.py +++ b/tests/view_tests/tests/test_specials.py @@ -13,15 +13,14 @@ class URLHandling(SimpleTestCase): def test_nonascii_redirect(self): """ - Tests that a non-ASCII argument to HttpRedirect is handled properly. + A non-ASCII argument to HttpRedirect is handled properly. """ response = self.client.get('/nonascii_redirect/') self.assertRedirects(response, self.redirect_target) def test_permanent_nonascii_redirect(self): """ - Tests that a non-ASCII argument to HttpPermanentRedirect is handled - properly. + A non-ASCII argument to HttpPermanentRedirect is handled properly. """ response = self.client.get('/permanent_nonascii_redirect/') self.assertRedirects(response, self.redirect_target, status_code=301) diff --git a/tests/view_tests/tests/test_static.py b/tests/view_tests/tests/test_static.py index 8492ec4547..457577264e 100644 --- a/tests/view_tests/tests/test_static.py +++ b/tests/view_tests/tests/test_static.py @@ -130,8 +130,7 @@ class StaticHelperTest(StaticTests): class StaticUtilsTests(unittest.TestCase): def test_was_modified_since_fp(self): """ - Test that a floating point mtime does not disturb was_modified_since. - (#18675) + A floating point mtime does not disturb was_modified_since (#18675). """ mtime = 1343416141.107817 header = http_date(mtime) diff --git a/tests/view_tests/views.py b/tests/view_tests/views.py index 97b984b758..bfcdc20a13 100644 --- a/tests/view_tests/views.py +++ b/tests/view_tests/views.py @@ -32,8 +32,7 @@ def with_parameter(request, parameter): def raises(request): # Make sure that a callable that raises an exception in the stack frame's - # local vars won't hijack the technical 500 response. See: - # http://code.djangoproject.com/ticket/15025 + # local vars won't hijack the technical 500 response (#15025). def callable(): raise Exception try: |
