flask-testing
flask-testing copied to clipboard
Unquote response location in assertRedirect
By default Flask url encodes query params which makes testing the location of a redirect slightly awkward.
eg. self.assertRedirects(res, '/login?next=/somewhere/') currently fails with
'http://localhost/?next=%2Fsomewhere%2F' != 'http://localhost/?next=/somewhere/'
This fixes the problem by unquoting the response location before asserting equality.
I guess this won't be merged as it is not Python 3 compatible (see failed CI build)?
The current state isn't python 3 compatible, but I also believe this should be kept as is by design. The query string parameter should be url encoded and the assertion should reflect that