Opened 15 years ago

Closed 15 years ago

#10971 closed (fixed)

Test client response.redirect_chain documentation example missing follow argument

Reported by: Charlie DeTar Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The documentation for the django test Client includes an example for showing redirect chains which is broken.

The provided example:

>>> response = c.get('/redirect_me')
>>> response.redirect_chain

results in:

AttributeError: 'HttpResponseRedirect' object has no attribute 'redirect_chain'

This is because follow was not set to True. The example should read:

>>> response = c.get('/redirect_me', follow=True)
>>> response.redirect_chain
[(u'http://testserver/next/', 302), (u'http://testserver/final/', 302)]

Attachments (1)

redirect_chain_docs.diff (594 bytes ) - added by Charlie DeTar 15 years ago.
Patch to fix redirect_chain documentation example

Download all attachments as: .zip

Change History (4)

by Charlie DeTar, 15 years ago

Attachment: redirect_chain_docs.diff added

Patch to fix redirect_chain documentation example

comment:1 by Charlie DeTar, 15 years ago

Component: UncategorizedDocumentation

comment:2 by Tim Graham, 15 years ago

Has patch: set
Triage Stage: UnreviewedReady for checkin

comment:3 by Karen Tracey, 15 years ago

Resolution: fixed
Status: newclosed

(In [10807]) Fixed #10971 -- Corrected code example involving redirect_chain in the testing doc. Thanks yourcelf.

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