diff options
| author | Katie McLaughlin <katie@glasnt.com> | 2019-09-14 12:47:15 +1000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-09-16 10:05:02 +0200 |
| commit | 242805c82be5ae9109b4b14335bcad3a3870571d (patch) | |
| tree | 0292de5cbad3f2f9a138ce1d98da50b4faeddbd1 /docs | |
| parent | 7806e4545452ae36c71d41c2b9b35f6e15df7b58 (diff) | |
[2.2.x] Fixed #30775 -- Added admonition about missing imports to "Running tests" section in tutorial 5.
Backport of 44077985f58be02214a11ffde35776fed3c960e1 from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/intro/tutorial02.txt | 5 | ||||
| -rw-r--r-- | docs/intro/tutorial05.txt | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt index 9046d167b0..01bee32a6c 100644 --- a/docs/intro/tutorial02.txt +++ b/docs/intro/tutorial02.txt @@ -443,8 +443,9 @@ models, not only for your own convenience when dealing with the interactive prompt, but also because objects' representations are used throughout Django's automatically-generated admin. -Note these are normal Python methods. Let's add a custom method, just for -demonstration: +.. _tutorial02-import-timezone: + +Let's also add a custom method to this model: .. code-block:: python :caption: polls/models.py diff --git a/docs/intro/tutorial05.txt b/docs/intro/tutorial05.txt index 42891a6ecd..b488fabba5 100644 --- a/docs/intro/tutorial05.txt +++ b/docs/intro/tutorial05.txt @@ -220,6 +220,13 @@ and you'll see something like:: FAILED (failures=1) Destroying test database for alias 'default'... +.. admonition:: Different error? + + If instead you're getting a ``NameError`` here, you may have missed a step + in :ref:`Part 2 <tutorial02-import-timezone>` where we added imports of + ``datetime`` and ``timezone`` to ``polls/models.py``. Copy the imports from + that section, and try running your tests again. + What happened is this: * ``manage.py test polls`` looked for tests in the ``polls`` application |
