1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Refs #36500 -- Rewrapped long docstrings and block comments via a script.

Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
This commit is contained in:
django-bot
2025-07-22 20:41:41 -07:00
committed by nessita
parent 55b0cc2131
commit 69a93a88ed
378 changed files with 2781 additions and 1861 deletions

View File

@@ -170,7 +170,8 @@ class PaginationTests(SimpleTestCase):
for paginator_class in [Paginator, AsyncPaginator]:
for orphans in [2, 3]:
with self.subTest(paginator_class=paginator_class, msg=msg):
# RemovedInDjango70Warning: When the deprecation ends, replace with:
# RemovedInDjango70Warning: When the deprecation ends,
# replace with:
# with self.assertRaisesMessage(ValueError, msg):
with self.assertWarnsMessage(RemovedInDjango70Warning, msg):
paginator_class([1, 2, 3], 2, orphans)
@@ -511,8 +512,8 @@ class PaginationTests(SimpleTestCase):
self,
):
"""
AsyncPaginator.aget_page() raises EmptyPage if allow_empty_first_page=False
and object_list is empty.
AsyncPaginator.aget_page() raises EmptyPage if
allow_empty_first_page=False and object_list is empty.
"""
paginator = AsyncPaginator([], 2, allow_empty_first_page=False)
with self.assertRaises(EmptyPage):
@@ -856,7 +857,8 @@ class ModelPaginationTests(TestCase):
self.assertIsNone(p.object_list._result_cache)
self.assertNotIsInstance(p.object_list, list)
# Make sure slicing the Page object with numbers and slice objects work.
# Make sure slicing the Page object with numbers and slice objects
# work.
self.assertEqual(p[0], self.articles[0])
self.assertSequenceEqual(p[slice(2)], self.articles[:2])
# After __getitem__ is called, object_list is a list
@@ -899,7 +901,8 @@ class ModelPaginationTests(TestCase):
with self.assertWarnsMessage(UnorderedObjectListWarning, msg) as cm:
AsyncPaginator(Article.objects.all(), 5)
# The warning points at the BasePaginator caller.
# The reason is that the UnorderedObjectListWarning occurs in BasePaginator.
# The reason is that the UnorderedObjectListWarning occurs in
# BasePaginator.
base_paginator_path = pathlib.Path(inspect.getfile(BasePaginator))
self.assertIn(
cm.filename,