Exemple #1
0
 def test_ask_search_raises_404_for_empty_query(self):
     request = HttpRequest()
     request.GET['q'] = ' '
     with self.assertRaises(Http404):
         ask_search(request, language='es')
     with self.assertRaises(Http404):
         ask_search(request, language='en')
Exemple #2
0
 def test_ask_search_encounters_facets(self, mock_redirect):
     request = HttpRequest()
     request.GET['selected_facets'] = 'category_exact:my_category'
     ask_search(request)
     self.assertEqual(mock_redirect.call_count, 1)
Exemple #3
0
 def test_ask_search_encounters_facets(self, mock_redirect):
     request = HttpRequest()
     request.GET['selected_facets'] = 'category_exact:my_category'
     ask_search(request)
     self.assertEqual(mock_redirect.call_count, 1)