Convert redirection-related tests to use assertRedirects.

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

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.

Summary ID
Convert redirection-related tests to use assertRedirects.
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.
1faf265b2b9f0b61f08a05356c9b5fa206d8d334
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (ee5859b)