##// END OF EJS Templates
search: fixed search tests
super-admin -
r5113:9cd499cc default
parent child Browse files
Show More
@@ -178,7 +178,10 b' class TestSearchController(TestControlle'
178 178 def test_filters_are_not_applied_for_admin_user(self):
179 179 self.log_user()
180 180 with mock.patch('whoosh.searching.Searcher.search') as search_mock:
181
181 search_mock.return_value = mock.MagicMock(
182 scored_length=lambda: 100,
183 runtime=10
184 )
182 185 self.app.get(route_path('search'),
183 186 {'q': 'test query', 'type': 'commit'})
184 187 assert search_mock.call_count == 1
@@ -188,6 +191,10 b' class TestSearchController(TestControlle'
188 191 def test_filters_are_applied_for_normal_user(self, enabled_backends):
189 192 self.log_user(TEST_USER_REGULAR_LOGIN, TEST_USER_REGULAR_PASS)
190 193 with mock.patch('whoosh.searching.Searcher.search') as search_mock:
194 search_mock.return_value = mock.MagicMock(
195 scored_length=lambda: 100,
196 runtime=10
197 )
191 198 self.app.get(route_path('search'),
192 199 {'q': 'test query', 'type': 'commit'})
193 200 assert search_mock.call_count == 1
@@ -129,7 +129,7 b' class WhooshSearcher(BaseSearcher):'
129 129 original_query = query
130 130 query = self._extend_query(query)
131 131
132 log.debug(u'QUERY: %s on %s', query, document_type)
132 log.debug('QUERY: %s on %s', query, document_type)
133 133 result = {
134 134 'results': [],
135 135 'count': 0,
General Comments 0
You need to be logged in to leave comments. Login now