Skip to content

Commit

Permalink
Simplify sanity check for followed redirect when follow=True not pass…
Browse files Browse the repository at this point in the history
…ed to test client.
  • Loading branch information
qris committed Jan 9, 2013
1 parent 1580d5a commit f03c5fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,10 @@ def assertFollowedRedirect(self, response, expected_url,

expected_uri = response.real_request.build_absolute_uri(expected_url)

self.assertNotIn(int(response.status_code), (301, 302),
"Response was a redirect, but was not followed. " +
"Please add follow=True to the request call")

message = "Response was not a redirect to %s: " % expected_uri
message += "(there should be a redirect chain)\n\n"

Expand Down

0 comments on commit f03c5fc

Please sign in to comment.