Fix wrong assumptions in assertRedirects

* Make the location check optional
* Don't make any assumptions about the location URL