diff options
author | Dalf <alex@al-f.net> | 2020-08-11 16:25:03 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2020-09-10 10:49:42 +0200 |
commit | c225db45c8a4ab466bff049216f7e0189dc1b067 (patch) | |
tree | 16be3299a6faf15538fc1f2cf181aadc422039fd /tests/unit | |
parent | 78883777438fc07833d983c50d9b131eb6feb9eb (diff) | |
download | searxng-c225db45c8a4ab466bff049216f7e0189dc1b067.tar.gz searxng-c225db45c8a4ab466bff049216f7e0189dc1b067.zip |
Drop Python 2 (4/n): SearchQuery.query is a str instead of bytes
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/test_plugins.py | 16 | ||||
-rw-r--r-- | tests/unit/test_utils.py | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/unit/test_plugins.py b/tests/unit/test_plugins.py index 10de8475a..838c1d574 100644 --- a/tests/unit/test_plugins.py +++ b/tests/unit/test_plugins.py @@ -48,11 +48,11 @@ class SelfIPTest(SearxTestCase): # IP test request = Mock(remote_addr='127.0.0.1') request.headers.getlist.return_value = [] - search = get_search_mock(query=b'ip', pageno=1) + search = get_search_mock(query='ip', pageno=1) store.call(store.plugins, 'post_search', request, search) self.assertTrue('127.0.0.1' in search.result_container.answers["ip"]["answer"]) - search = get_search_mock(query=b'ip', pageno=2) + search = get_search_mock(query='ip', pageno=2) store.call(store.plugins, 'post_search', request, search) self.assertFalse('ip' in search.result_container.answers) @@ -60,26 +60,26 @@ class SelfIPTest(SearxTestCase): request = Mock(user_agent='Mock') request.headers.getlist.return_value = [] - search = get_search_mock(query=b'user-agent', pageno=1) + search = get_search_mock(query='user-agent', pageno=1) store.call(store.plugins, 'post_search', request, search) self.assertTrue('Mock' in search.result_container.answers["user-agent"]["answer"]) - search = get_search_mock(query=b'user-agent', pageno=2) + search = get_search_mock(query='user-agent', pageno=2) store.call(store.plugins, 'post_search', request, search) self.assertFalse('user-agent' in search.result_container.answers) - search = get_search_mock(query=b'user-agent', pageno=1) + search = get_search_mock(query='user-agent', pageno=1) store.call(store.plugins, 'post_search', request, search) self.assertTrue('Mock' in search.result_container.answers["user-agent"]["answer"]) - search = get_search_mock(query=b'user-agent', pageno=2) + search = get_search_mock(query='user-agent', pageno=2) store.call(store.plugins, 'post_search', request, search) self.assertFalse('user-agent' in search.result_container.answers) - search = get_search_mock(query=b'What is my User-Agent?', pageno=1) + search = get_search_mock(query='What is my User-Agent?', pageno=1) store.call(store.plugins, 'post_search', request, search) self.assertTrue('Mock' in search.result_container.answers["user-agent"]["answer"]) - search = get_search_mock(query=b'What is my User-Agent?', pageno=2) + search = get_search_mock(query='What is my User-Agent?', pageno=2) store.call(store.plugins, 'post_search', request, search) self.assertFalse('user-agent' in search.result_container.answers) diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index f7fc7c0e4..5f98511c3 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -30,9 +30,9 @@ class TestUtils(SearxTestCase): self.assertEqual(utils.highlight_content(content, None), content) content = 'a' - query = b'test' + query = 'test' self.assertEqual(utils.highlight_content(content, query), content) - query = b'a test' + query = 'a test' self.assertEqual(utils.highlight_content(content, query), content) def test_html_to_text(self): |