mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.
This commit is contained in:
parent
4bb70cbcc6
commit
321e94fa41
185 changed files with 1216 additions and 1528 deletions
|
@ -76,14 +76,14 @@ class ViewTest(unittest.TestCase):
|
|||
|
||||
def test_no_init_kwargs(self):
|
||||
"""
|
||||
Test that a view can't be accidentally instantiated before deployment
|
||||
A view can't be accidentally instantiated before deployment
|
||||
"""
|
||||
with self.assertRaises(AttributeError):
|
||||
SimpleView(key='value').as_view()
|
||||
|
||||
def test_no_init_args(self):
|
||||
"""
|
||||
Test that a view can't be accidentally instantiated before deployment
|
||||
A view can't be accidentally instantiated before deployment
|
||||
"""
|
||||
with self.assertRaises(TypeError):
|
||||
SimpleView.as_view('value')
|
||||
|
@ -133,7 +133,7 @@ class ViewTest(unittest.TestCase):
|
|||
|
||||
def test_invalid_keyword_argument(self):
|
||||
"""
|
||||
Test that view arguments must be predefined on the class and can't
|
||||
View arguments must be predefined on the class and can't
|
||||
be named like a HTTP method.
|
||||
"""
|
||||
# Check each of the allowed method names
|
||||
|
@ -158,7 +158,7 @@ class ViewTest(unittest.TestCase):
|
|||
|
||||
def test_class_attributes(self):
|
||||
"""
|
||||
Test that the callable returned from as_view() has proper
|
||||
The callable returned from as_view() has proper
|
||||
docstring, name and module.
|
||||
"""
|
||||
self.assertEqual(SimpleView.__doc__, SimpleView.as_view().__doc__)
|
||||
|
@ -167,14 +167,14 @@ class ViewTest(unittest.TestCase):
|
|||
|
||||
def test_dispatch_decoration(self):
|
||||
"""
|
||||
Test that attributes set by decorators on the dispatch method
|
||||
Attributes set by decorators on the dispatch method
|
||||
are also present on the closure.
|
||||
"""
|
||||
self.assertTrue(DecoratedDispatchView.as_view().is_decorated)
|
||||
|
||||
def test_options(self):
|
||||
"""
|
||||
Test that views respond to HTTP OPTIONS requests with an Allow header
|
||||
Views respond to HTTP OPTIONS requests with an Allow header
|
||||
appropriate for the methods implemented by the view class.
|
||||
"""
|
||||
request = self.rf.options('/')
|
||||
|
@ -185,7 +185,7 @@ class ViewTest(unittest.TestCase):
|
|||
|
||||
def test_options_for_get_view(self):
|
||||
"""
|
||||
Test that a view implementing GET allows GET and HEAD.
|
||||
A view implementing GET allows GET and HEAD.
|
||||
"""
|
||||
request = self.rf.options('/')
|
||||
view = SimpleView.as_view()
|
||||
|
@ -194,7 +194,7 @@ class ViewTest(unittest.TestCase):
|
|||
|
||||
def test_options_for_get_and_post_view(self):
|
||||
"""
|
||||
Test that a view implementing GET and POST allows GET, HEAD, and POST.
|
||||
A view implementing GET and POST allows GET, HEAD, and POST.
|
||||
"""
|
||||
request = self.rf.options('/')
|
||||
view = SimplePostView.as_view()
|
||||
|
@ -203,7 +203,7 @@ class ViewTest(unittest.TestCase):
|
|||
|
||||
def test_options_for_post_view(self):
|
||||
"""
|
||||
Test that a view implementing POST allows POST.
|
||||
A view implementing POST allows POST.
|
||||
"""
|
||||
request = self.rf.options('/')
|
||||
view = PostOnlyView.as_view()
|
||||
|
|
|
@ -670,9 +670,8 @@ class DateDetailViewTests(TestDataMixin, TestCase):
|
|||
|
||||
def test_get_object_custom_queryset(self):
|
||||
"""
|
||||
Ensure that custom querysets are used when provided to
|
||||
BaseDateDetailView.get_object()
|
||||
Refs #16918.
|
||||
Custom querysets are used when provided to
|
||||
BaseDateDetailView.get_object().
|
||||
"""
|
||||
res = self.client.get(
|
||||
'/dates/books/get_object_custom_queryset/2006/may/01/%s/' % self.book2.pk)
|
||||
|
|
|
@ -59,7 +59,7 @@ class ListViewTests(TestCase):
|
|||
self.assertEqual(list(res.context['author_list'])[-1].name, 'Author 29')
|
||||
|
||||
def test_paginated_queryset_shortdata(self):
|
||||
# Test that short datasets ALSO result in a paginated view.
|
||||
# Short datasets also result in a paginated view.
|
||||
res = self.client.get('/list/authors/paginated/')
|
||||
self.assertEqual(res.status_code, 200)
|
||||
self.assertTemplateUsed(res, 'generic_views/author_list.html')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue