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]})
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)
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)