#34334 closed Bug (duplicate)
There might be an error in the Django Tutorial No. 5
Reported by: | alv2017 | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 4.1 |
Severity: | Normal | Keywords: | Documentation Tutorial Bug |
Cc: | v.alishauskaite@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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
Change History (4)
follow-up: 2 comment:1 by , 23 months ago
Component: | Error reporting → Documentation |
---|---|
Owner: | set to |
Resolution: | → duplicate |
Status: | new → closed |
comment:2 by , 23 months ago
Replying to 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?
I would agree with you if you were speaking about the shell script, but for application tests, I'm afraid, this is not true.
follow-up: 4 comment:3 by , 22 months ago
Django's test runner calls setup_test_environment()
. Is it not working for you?
comment:4 by , 22 months ago
Replying to 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.
Duplicate of #22912. Please re-read the tutorial's mention of
setup_test_environment()
and make sure you call it.