Convert redirection-related tests to use assertRedirects.

Review Request #10477 — Created March 30, 2019 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

We have a number of unit tests that check for HTTP responses that
redirect to a different URL, and most of these are checking headers and
response codes manually rather than using assertRedirects. The
advantage of assertRedirects is that we'd get the status codes and URL
checks built-in, but it also offers us a compatibility advantage. In
modern versions of Django, redirection URLs changed from absolute to
relative, and assertRedirects knows how to factor this in for tests.

This change updates these unit tests to use assertRedirects instead,
giving us compatibility across Django 1.6 and 1.11 for these tests.

Unit tests pass on Django 1.6 and 1.11.

Commits

Files