Opened 9 years ago

Closed 9 years ago

#4968 closed (fixed)

assertRedirects doesn't respect query params

Reported by: Ivan Sagalaev <Maniac@…> Owned by: russellm
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:


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.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 9 years ago by russellm

  • Cc russelm removed
  • Needs documentation unset
  • Needs tests set
  • Owner changed from adrian to russellm
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

This is oversight. Patch and test case welcome.

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


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 changed from Accepted to Ready for checkin

Looks good, Ivan

comment:4 Changed 9 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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