[ckan-changes] [ckan/ckan] b2f25f: Test app urls need to be str type

David Read noreply at github.com
Thu Aug 22 07:28:49 UTC 2019


  Branch: refs/heads/werkzeug-0.15
  Home:   https://github.com/ckan/ckan
  Commit: b2f25f966660eed95d2e200379c1cadb1719423b
      https://github.com/ckan/ckan/commit/b2f25f966660eed95d2e200379c1cadb1719423b
  Author: David Read <david.read at hackneyworkshop.com>
  Date:   2019-08-22 (Thu, 22 Aug 2019)

  Changed paths:
    M ckan/tests/controllers/test_home.py
    M ckan/tests/helpers.py
    M ckan/tests/legacy/functional/test_preview_interface.py
    M ckanext/datastore/tests/test_info.py
    M ckanext/multilingual/tests/test_multilingual_plugin.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 PATH_INFO 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