diff options
Diffstat (limited to 'tests/unit/test_webapp.py')
| -rw-r--r-- | tests/unit/test_webapp.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py index f31332fa0..7dd465898 100644 --- a/tests/unit/test_webapp.py +++ b/tests/unit/test_webapp.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- import json +from urllib.parse import ParseResult from mock import Mock from searx import webapp from searx.testing import SearxTestCase from searx.search import Search -from searx.url_utils import ParseResult class ViewsTestCase(SearxTestCase): @@ -48,7 +48,7 @@ class ViewsTestCase(SearxTestCase): def search_mock(search_self, *args): search_self.result_container = Mock(get_ordered_results=lambda: test_results, - answers=set(), + answers=dict(), corrections=set(), suggestions=set(), infoboxes=[], @@ -56,7 +56,8 @@ class ViewsTestCase(SearxTestCase): results=test_results, results_number=lambda: 3, results_length=lambda: len(test_results), - get_timings=lambda: timings) + get_timings=lambda: timings, + redirect_url=None) self.setattr4test(Search, 'search', search_mock) @@ -88,7 +89,7 @@ class ViewsTestCase(SearxTestCase): def test_index_json(self): result = self.app.post('/', data={'q': 'test', 'format': 'json'}) - result_dict = json.loads(result.data.decode('utf-8')) + result_dict = json.loads(result.data.decode()) self.assertEqual('test', result_dict['query']) self.assertEqual(len(result_dict['results']), 2) |