diff options
-rw-r--r-- | searx/plugins/self_info.py | 2 | ||||
-rw-r--r-- | tests/unit/test_plugins.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/searx/plugins/self_info.py b/searx/plugins/self_info.py index b2e714593..7cad040d2 100644 --- a/searx/plugins/self_info.py +++ b/searx/plugins/self_info.py @@ -28,5 +28,5 @@ def post_search(request, search): search.result_container.answers['ip'] = {'answer': gettext('Your IP is: ') + ip} elif ua_regex.match(search.search_query.query): ua = request.user_agent - search.result_container.answers['user-agent'] = {'answer': gettext('Your user-agent is: ') + ua} + search.result_container.answers['user-agent'] = {'answer': gettext('Your user-agent is: ') + ua.string} return True diff --git a/tests/unit/test_plugins.py b/tests/unit/test_plugins.py index a5a2f0471..72d68ba29 100644 --- a/tests/unit/test_plugins.py +++ b/tests/unit/test_plugins.py @@ -74,7 +74,7 @@ class SelfIPTest(SearxTestCase): # pylint: disable=missing-class-docstring self.assertFalse('ip' in search.result_container.answers) # User agent test - request = Mock(user_agent='Mock') + request = Mock(user_agent=Mock(string='Mock')) search = get_search_mock(query='user-agent', pageno=1) store.call(store.plugins, 'post_search', request, search) |