Ejemplo n.º 1
0
 def test_internal_error(self):
     c = Client()
     with patch('search.court_search.CourtSearch.get_courts',
                Mock(side_effect=CourtSearchError('something went wrong'))):
         response = c.get('/search/results.json?q=Accrington')
         self.assertEquals(500, response.status_code)
         self.assertIn("something went wrong", response.content)
Ejemplo n.º 2
0
 def test_court_postcode_search_error(self):
     with patch('search.court_search.CourtSearch.get_courts',
                Mock(side_effect=CourtSearchError('something went wrong'))):
         c = Client()
         with self.assertRaises(CourtSearchError):
             response = c.get('/search/results?postcode=SE15+4PE')
Ejemplo n.º 3
0
 def test_court_address_search_error(self):
     with patch('search.court_search.CourtSearch.get_courts',
                Mock(side_effect=CourtSearchError('something went wrong'))):
         c = Client()
         with self.assertRaises(CourtSearchError):
             response = c.get('/search/results?q=Accrington')