Opened 3 years ago

Closed 3 years ago

#21017 closed Uncategorized (invalid)

code error in v1.5 tutorial 5

Reported by: rzjint1@… Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords:
Cc: rzjint1@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

>>> response.context['latest_poll_list']
[<Poll: Who is your favorite Beatle?>]

should be response.context_data

Change History (2)

comment:1 Changed 3 years ago by Marc Tamlyn

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

This seems to also apply to 1.6 and master

comment:2 Changed 3 years ago by Tim Graham

Resolution: invalid
Status: newclosed

Unless I'm missing something, the tutorial is correct as-is. Here's the relevant documentation:

https://docs.djangoproject.com/en/dev/topics/testing/overview/#django.test.client.Response.context

Making the suggested change results in AttributeError: 'HttpResponse' object has no attribute 'context_data'

Note: See TracTickets for help on using tickets.
Back to Top