Opened 9 years ago

Closed 9 years ago

#4968 closed (fixed)

assertRedirects doesn't respect query params

Reported by: Ivan Sagalaev <Maniac@…> Owned by: Russell Keith-Magee
Component: Testing framework Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

assertRedirects now parses out only a path from a redirect location and uses it to fetch a new response. Is there any reason why it leaves out query params? It doesn't work now for redirects like HttpResponseRedirect('?name=value')

The fix is simple but I wanted to check if it's by design.

Attachments (1)

4968.diff (5.0 KB) - added by Ivan Sagalaev <Maniac@…> 9 years ago.
Patch

Download all attachments as: .zip

Change History (5)

comment:1 Changed 9 years ago by Russell Keith-Magee

Cc: russelm removed
Needs tests: set
Owner: changed from Adrian Holovaty to Russell Keith-Magee
Triage Stage: UnreviewedAccepted

This is oversight. Patch and test case welcome.

Changed 9 years ago by Ivan Sagalaev <Maniac@…>

Attachment: 4968.diff added

Patch

comment:2 Changed 9 years ago by Ivan Sagalaev <Maniac@…>

Has patch: set

Patch attached. One non-obvious point: I've replaced "urlparse" with "urlsplit" because the former splits an additional "parameter" part of a path which is not needed anyway.

comment:3 Changed 9 years ago by Simon G. <dev@…>

Needs tests: unset
Triage Stage: AcceptedReady for checkin

Looks good, Ivan

comment:4 Changed 9 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [6031]) Fixed #4968 -- Added assertRedirects handling for paths with GET data. Thanks for the patch, Ivan Sagalaev.

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