Opened 11 years ago

Closed 11 years ago

#20919 closed New feature (fixed)

assertRedirects without loading the target page

Reported by: Marc Tamlyn Owned by: jcatalan
Component: Testing framework Version: dev
Severity: Normal Keywords: assertRedirects
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It would be nice to have a version/extension of assertRedirects which does not require loading the target page with the client. My test suites already have tests for the target pages in most cases, and the extra overhead of calling and rendering the second page each time seems like overkill. The general thing I want to test is "this response redirects to the url with name 'foo'" rather than "this response redirects to url /foo and it works".

This would also handle the issue of checking redirects to external sites without having to go hunting for headers['Location'].

Change History (5)

comment:1 by Tim Graham, 11 years ago

Triage Stage: UnreviewedAccepted

I've also wished for this.

comment:2 by jcatalan, 11 years ago

Owner: changed from nobody to jcatalan
Status: newassigned

comment:3 by jcatalan, 11 years ago

I also wanted this once, so I think it would be a useful thing to have. I've submitted this PR with a patch. Please, let me know what do you think!

comment:4 by jcatalan, 11 years ago

Has patch: set

comment:5 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In 4840fd9cbc3987781f7e6fab2520c9bd42aec057:

Fixed #20919 -- Extended assertRedirects to be able to avoid fetching redirect's response.

Thanks mjtamlyn for the suggestion.

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