[ckan-changes] [ckan/ckan] 2140a1: Test app urls need to be str type
David Read
noreply at github.com
Wed Aug 21 22:01:06 UTC 2019
Branch: refs/heads/werkzeug-0.15
Home: https://github.com/ckan/ckan
Commit: 2140a1b68f0988f2cd99b79aab1c8d3e2107a31d
https://github.com/ckan/ckan/commit/2140a1b68f0988f2cd99b79aab1c8d3e2107a31d
Author: David Read <david.read at hackneyworkshop.com>
Date: 2019-08-21 (Wed, 21 Aug 2019)
Changed paths:
M ckan/tests/helpers.py
Log Message:
-----------
Test app urls need to be str type
With this upgrade of werkzeug, url_for now returns unicode, rather than a str. I'm not clear where that happens, but flask uses lots of bits of werkzeug underneath.
The exception occurs because WSGI requires environ.PATH_INFO to be a string (bytes, not unicode). This is being checked by webtest.lint (the newest version does the same check). PATH_INFO is the part of the WSGI request storing the URL's path. WebOb needs to save it as str, but our old version, webob.request stores it in whatever encoding we give it, so we need to specify the URL already encoded.
I'm not 100% sure that UTF8 is the correct encoding - it might need url (percent) encoding, but for these tests it doesn't make any difference.
More information about the ckan-changes
mailing list