diff --git a/rhodecode/apps/search/tests/test_search.py b/rhodecode/apps/search/tests/test_search.py --- a/rhodecode/apps/search/tests/test_search.py +++ b/rhodecode/apps/search/tests/test_search.py @@ -178,7 +178,10 @@ class TestSearchController(TestControlle def test_filters_are_not_applied_for_admin_user(self): self.log_user() with mock.patch('whoosh.searching.Searcher.search') as search_mock: - + search_mock.return_value = mock.MagicMock( + scored_length=lambda: 100, + runtime=10 + ) self.app.get(route_path('search'), {'q': 'test query', 'type': 'commit'}) assert search_mock.call_count == 1 @@ -188,6 +191,10 @@ class TestSearchController(TestControlle def test_filters_are_applied_for_normal_user(self, enabled_backends): self.log_user(TEST_USER_REGULAR_LOGIN, TEST_USER_REGULAR_PASS) with mock.patch('whoosh.searching.Searcher.search') as search_mock: + search_mock.return_value = mock.MagicMock( + scored_length=lambda: 100, + runtime=10 + ) self.app.get(route_path('search'), {'q': 'test query', 'type': 'commit'}) assert search_mock.call_count == 1 diff --git a/rhodecode/lib/index/whoosh.py b/rhodecode/lib/index/whoosh.py --- a/rhodecode/lib/index/whoosh.py +++ b/rhodecode/lib/index/whoosh.py @@ -129,7 +129,7 @@ class WhooshSearcher(BaseSearcher): original_query = query query = self._extend_query(query) - log.debug(u'QUERY: %s on %s', query, document_type) + log.debug('QUERY: %s on %s', query, document_type) result = { 'results': [], 'count': 0,