def METHOD_NAME(self, m, search_candidates):
    search_candidates.return_value = {'results': [{'name': 'Abe Lincoln'}]}
    request = self.factory.get('/search?query=abe&type=candidates')
    response = search(request)
    search_candidates.assert_called_with('abe')
    self.assertEqual(response.status_code, 200)