[Django] #34334: There might be an error in the Django Tutorial No. 5

12 views
Skip to first unread message

Django

unread,
Feb 12, 2023, 4:31:09 PM2/12/23
to django-...@googlegroups.com
#34334: There might be an error in the Django Tutorial No. 5
-------------------------------------+-------------------------------------
Reporter: alv2017 | Owner: (none)
Type: Bug | Status: new
Component: Error | Version: 4.1
reporting | Keywords: Documentation
Severity: Normal | Tutorial Bug
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
At the moment I'm going through the fifth Django Tutorial on unit testing:
https://docs.djangoproject.com/en/4.1/intro/tutorial05/

I notices that in a number of places the following expression is used:

{{{
response.context['latest_question_list']
}}}


This doesn't work, and I think that instead there should be


{{{
response.context_data['latest_question_list']
}}}


I'm using Django 4.1.6

Brgds,
Vitalija

--
Ticket URL: <https://code.djangoproject.com/ticket/34334>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 12, 2023, 5:31:51 PM2/12/23
to django-...@googlegroups.com
#34334: There might be an error in the Django Tutorial No. 5
-------------------------------------+-------------------------------------
Reporter: alv2017 | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: duplicate
Keywords: Documentation | Triage Stage:
Tutorial Bug | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* owner: (none) => nobody
* resolution: => duplicate
* status: new => closed
* component: Error reporting => Documentation


Comment:

Duplicate of #22912. Please re-read the tutorial's mention of
`setup_test_environment()` and make sure you call it.

--
Ticket URL: <https://code.djangoproject.com/ticket/34334#comment:1>

Django

unread,
Feb 12, 2023, 6:27:26 PM2/12/23
to django-...@googlegroups.com
#34334: There might be an error in the Django Tutorial No. 5
-------------------------------------+-------------------------------------
Reporter: alv2017 | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: duplicate
Keywords: Documentation | Triage Stage:
Tutorial Bug | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by alv2017):

Replying to [comment:1 Tim Graham]:


> Duplicate of #22912. Please re-read the tutorial's mention of
`setup_test_environment()` and make sure you call it.

Hmm... What about the actual tests?

--
Ticket URL: <https://code.djangoproject.com/ticket/34334#comment:2>

Django

unread,
Feb 12, 2023, 7:34:33 PM2/12/23
to django-...@googlegroups.com
#34334: There might be an error in the Django Tutorial No. 5
-------------------------------------+-------------------------------------
Reporter: alv2017 | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: duplicate
Keywords: Documentation | Triage Stage:
Tutorial Bug | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

Django's test runner calls `setup_test_environment()`. Is it not working
for you?

--
Ticket URL: <https://code.djangoproject.com/ticket/34334#comment:3>

Django

unread,
Feb 13, 2023, 4:56:57 AM2/13/23
to django-...@googlegroups.com
#34334: There might be an error in the Django Tutorial No. 5
-------------------------------------+-------------------------------------
Reporter: alv2017 | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: duplicate
Keywords: Documentation | Triage Stage:
Tutorial Bug | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by alv2017):

Replying to [comment:3 Tim Graham]:


> Django's test runner calls `setup_test_environment()`. Is it not working
for you?


Thanks for the explanation Tim. I didn't realize at the beginning that
setup_test_environment() is running under the hood when tests are run.

--
Ticket URL: <https://code.djangoproject.com/ticket/34334#comment:4>

Reply all
Reply to author
Forward
0 new messages