def actual_exception_cause(self): try: return content_json(self.actual_response)['reason'] except ValueError: return 'not a json response' except KeyError: return 'no error reason'
def _get_response_json_content(): try: return content_json(self.actual_response) except ValueError: testcase.fail( 'expected a json response, got: "{}"'.format(self.actual_response.content.decode('utf-8')))
def _get_response_json_content(): try: return content_json(self.actual_response) except ValueError: testcase.fail('expected a json response, got: "{}"'.format( self.actual_response.content.decode('utf-8')))