Esempio n. 1
0
 def test_es_disabled(self):
     response = ESExceptionMiddleware().process_request(self.fake_request)
     eq_(response.status_code, 501)
Esempio n. 2
0
 def test_es_disabled(self):
     response = ESExceptionMiddleware().process_request(self.fake_request)
     eq_(response.status_code, 501)
     self.assertTemplateUsed(response, 'elasticutils/501.html')
Esempio n. 3
0
 def test_exceptions(self):
     for exc in ES_EXCEPTIONS:
         response = ESExceptionMiddleware().process_exception(
             self.fake_request, exc(Exception))
         eq_(response.status_code, 503)
Esempio n. 4
0
 def test_exceptions(self):
     for exc in ES_EXCEPTIONS:
         response = ESExceptionMiddleware().process_exception(
             self.fake_request, exc(Exception))
         eq_(response.status_code, 503)
         self.assertTemplateUsed(response, 'elasticutils/503.html')