diff --git a/ckan/tests/controllers/test_home.py b/ckan/tests/controllers/test_home.py index 038aa926f11..6b0287888fa 100644 --- a/ckan/tests/controllers/test_home.py +++ b/ckan/tests/controllers/test_home.py @@ -44,7 +44,7 @@ def test_email_address_nag(self): response = app.get(url=url_for('home.index'), extra_environ=env) assert 'update your profile' in response.body - assert url_for('user.edit') in response.body + assert str(url_for('user.edit')) in response.body assert ' and add your email address.' in response.body def test_email_address_no_nag(self): diff --git a/ckan/tests/helpers.py b/ckan/tests/helpers.py index 520b417d9dd..5586e000987 100644 --- a/ckan/tests/helpers.py +++ b/ckan/tests/helpers.py @@ -155,6 +155,10 @@ def flask_app(self): self._flask_app = self.app.apps['flask_app']._wsgi_app return self._flask_app + def post(self, url, *args, **kwargs): + url = url.encode('utf8') # or maybe it should be url_encoded? + return super(CKANTestApp, self).post(url, *args, **kwargs) + def _get_test_app(): '''Return a webtest.TestApp for CKAN, with legacy templates disabled. diff --git a/ckan/tests/legacy/functional/test_preview_interface.py b/ckan/tests/legacy/functional/test_preview_interface.py index 73b9c628328..69f92a5f812 100644 --- a/ckan/tests/legacy/functional/test_preview_interface.py +++ b/ckan/tests/legacy/functional/test_preview_interface.py @@ -87,4 +87,4 @@ def test_iframe_is_shown(self): def test_iframe_url_is_correct(self): result = self.app.get(self.url) - assert self.preview_url in result.body, (self.preview_url, result.body) + assert str(self.preview_url) in result.body, (self.preview_url, result.body) diff --git a/ckanext/datastore/tests/test_info.py b/ckanext/datastore/tests/test_info.py index e351b7b38dd..7aee08e398a 100644 --- a/ckanext/datastore/tests/test_info.py +++ b/ckanext/datastore/tests/test_info.py @@ -73,4 +73,4 @@ def test_api_info(self): "http://test.ckan.net/api/3/action/datastore_search?resource_id=588dfa82-760c-45a2-b78a-e3bc314a4a9b&limit=5&q=title:jones", ) for url in expected_urls: - assert url in page, url + assert str(url) in page, url diff --git a/ckanext/multilingual/tests/test_multilingual_plugin.py b/ckanext/multilingual/tests/test_multilingual_plugin.py index 8e5fbebd2c9..44dd082518b 100644 --- a/ckanext/multilingual/tests/test_multilingual_plugin.py +++ b/ckanext/multilingual/tests/test_multilingual_plugin.py @@ -71,8 +71,8 @@ def test_user_read_translation(self): # It is testsysadmin who created the dataset, so testsysadmin whom # we'd expect to see the datasets for. for user_name in ('testsysadmin',): - offset = h.url_for( - 'user.read', id=user_name) + offset = str(h.url_for( + 'user.read', id=user_name)) for (lang_code, translations) in ( ('de', _create_test_data.german_translations), ('fr', _create_test_data.french_translations),