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

David Read noreply at github.com
Wed Aug 21 22:13:03 UTC 2019


  Branch: refs/heads/werkzeug-0.15
  Home:   https://github.com/ckan/ckan
  Commit: 7c0dc16f37da57061be3d89f7c8667335f1702ff
      https://github.com/ckan/ckan/commit/7c0dc16f37da57061be3d89f7c8667335f1702ff
  Author: David Read <david.read at hackneyworkshop.com>
  Date:   2019-08-21 (Wed, 21 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