From fd67df7d7c7a8efee42015119593b29a42f31ec3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 07:05:40 +0000 Subject: [PATCH 1/2] Bump black from 22.1.0 to 22.3.0 Bumps [black](https://github.com/psf/black) from 22.1.0 to 22.3.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/22.1.0...22.3.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 970c3811e..13134d16e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ mock==4.0.3 nose2[coverage_plugin]==0.11.0 cov-core==1.15.0 -black==22.1.0 +black==22.3.0 pycodestyle==2.8.0 pylint==2.13.0 splinter==0.17.0 From 6c747c40c10ee3259e8ef48b2d701a0c8f96a47d Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 1 Apr 2022 10:27:41 +0200 Subject: [PATCH 2/2] [fix] issue when upgrading from werkzeug v2.0.3 to v2.1.0 In v2.1.0 werkzeug [1] fixed an issue [2] to keep relative redirect locations by default [3]. Since relative locations are returned, we need to fix out test cases to avoid AssertionErrors like this one:: ====================================================================== FAIL: test_index_html_get (tests.unit.test_webapp.ViewsTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/searxng/searxng/tests/unit/test_webapp.py", line 105, in test_index_html_get self.assertEqual(result.location, 'http://localhost/search?q=test') AssertionError: '/search?q=test' != 'http://localhost/search?q=test' - /search?q=test + http://localhost/search?q=test [1] https://werkzeug.palletsprojects.com/ [2] https://github.com/pallets/werkzeug/issues/2352 fixed in [3] https://github.com/pallets/werkzeug/pull/2354 Related-to: https://github.com/searxng/searxng/pull/1039#issuecomment-1085538288 Signed-off-by: Markus Heiser --- tests/unit/test_webapp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py index d3eaa6a58..bb09e591e 100644 --- a/tests/unit/test_webapp.py +++ b/tests/unit/test_webapp.py @@ -97,12 +97,12 @@ class ViewsTestCase(SearxTestCase): def test_index_html_post(self): result = self.app.post('/', data={'q': 'test'}) self.assertEqual(result.status_code, 308) - self.assertEqual(result.location, 'http://localhost/search') + self.assertEqual(result.location, '/search') def test_index_html_get(self): result = self.app.post('/?q=test') self.assertEqual(result.status_code, 308) - self.assertEqual(result.location, 'http://localhost/search?q=test') + self.assertEqual(result.location, '/search?q=test') def test_search_empty_html(self): result = self.app.post('/search', data={'q': ''})