diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-05-31 07:40:54 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-06-27 08:04:25 +0200 |
| commit | 4d20d2f7c2b8e74c3e85bd0716ebdcb3b35a70e6 (patch) | |
| tree | 40722f3317489da559dce2c04da404f1fe61709d /docs/intro/tutorial05.txt | |
| parent | 8a294ee2e0e30f073f764310c74899e385a302ec (diff) | |
[4.0.x] Fixed docs build with sphinxcontrib-spelling 7.5.0+.
sphinxcontrib-spelling 7.5.0+ includes captions of figures in the set
of nodes for which the text is checked.
Backport of ac90529cc58507d9a07610809a795ec5fc3cbf8c from main.
Diffstat (limited to 'docs/intro/tutorial05.txt')
| -rw-r--r-- | docs/intro/tutorial05.txt | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/intro/tutorial05.txt b/docs/intro/tutorial05.txt index e546f2d79a..4a453a83b6 100644 --- a/docs/intro/tutorial05.txt +++ b/docs/intro/tutorial05.txt @@ -172,7 +172,7 @@ whose name begins with ``test``. Put the following in the ``tests.py`` file in the ``polls`` application: .. code-block:: python - :caption: polls/tests.py + :caption: ``polls/tests.py`` import datetime @@ -261,7 +261,7 @@ return ``False`` if its ``pub_date`` is in the future. Amend the method in past: .. code-block:: python - :caption: polls/models.py + :caption: ``polls/models.py`` def was_published_recently(self): now = timezone.now() @@ -297,7 +297,7 @@ Add two more test methods to the same class, to test the behavior of the method more comprehensively: .. code-block:: python - :caption: polls/tests.py + :caption: ``polls/tests.py`` def test_was_published_recently_with_old_question(self): """ @@ -413,7 +413,7 @@ In :doc:`Tutorial 4 </intro/tutorial04>` we introduced a class-based view, based on :class:`~django.views.generic.list.ListView`: .. code-block:: python - :caption: polls/views.py + :caption: ``polls/views.py`` class IndexView(generic.ListView): template_name = 'polls/index.html' @@ -428,14 +428,14 @@ checks the date by comparing it with ``timezone.now()``. First we need to add an import: .. code-block:: python - :caption: polls/views.py + :caption: ``polls/views.py`` from django.utils import timezone and then we must amend the ``get_queryset`` method like so: .. code-block:: python - :caption: polls/views.py + :caption: ``polls/views.py`` def get_queryset(self): """ @@ -463,7 +463,7 @@ our :djadmin:`shell` session above. Add the following to ``polls/tests.py``: .. code-block:: python - :caption: polls/tests.py + :caption: ``polls/tests.py`` from django.urls import reverse @@ -471,7 +471,7 @@ and we'll create a shortcut function to create questions as well as a new test class: .. code-block:: python - :caption: polls/tests.py + :caption: ``polls/tests.py`` def create_question(question_text, days): """ @@ -572,7 +572,7 @@ the *index*, users can still reach them if they know or guess the right URL. So we need to add a similar constraint to ``DetailView``: .. code-block:: python - :caption: polls/views.py + :caption: ``polls/views.py`` class DetailView(generic.DetailView): ... @@ -587,7 +587,7 @@ is in the past can be displayed, and that one with a ``pub_date`` in the future is not: .. code-block:: python - :caption: polls/tests.py + :caption: ``polls/tests.py`` class QuestionDetailViewTests(TestCase): def test_future_question(self): |
