예제 #1
0
    def test_500_with_custom_response(self):
        exc = HttpServerError()
        exc.content = {'detail': 'some info'}
        response = 'custom response'

        res, data = self.json(error_500(self.request, exception=exc,
                                        response=response))
        eq_(data['error_response'], {'__all__': [response]})
예제 #2
0
 def test_solitude_error_with_content(self):
     exc = HttpServerError('500')
     exc.content = {'cache': True}
     self.solitude.services.status.get.side_effect = exc
     res, data = self.data()
     eq_(data['solitude']['error_response'], exc.content)
예제 #3
0
 def test_500_with_exception(self):
     exc = HttpServerError()
     exc.content = {'detail': 'some info'}
     res, data = self.json(error_500(self.request, exception=exc))
     eq_(res.status_code, 500, res)
     eq_(data['error_response'], exc.content)