Skip to content

Conversation

dannymidnight
Copy link

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.

By default Flask url encodes query params which makes testing the
location of a redirect slightly awkward.

This fixes the problem by unquoting the url making for simpler assertions.

eg. `self.assertRedirects(res, '/login?next=/account')`
@jcass77
Copy link
Contributor

jcass77 commented Oct 13, 2016

I guess this won't be merged as it is not Python 3 compatible (see failed CI build)?

@jcomo
Copy link
Collaborator

jcomo commented Oct 14, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants