'If the decorated function raises an exception, the HTTP response body
is a json-encoded object with a item set to an incident
identifier.'

@validateLogging(None)
def test_responseResultContainsIncident(self, logger):

    request = dummyRequest('GET', '/foo/exception', Headers(), '')
    app = self.application(logger, None)
    self.render(app.app.resource(), request)
    logger.flushTracebacks(ArbitraryException)
    incident = loads(request._responseBody)
    action = LoggedAction.ofType(logger.messages, REQUEST)[0]
    self.assertEqual(u'{}@/2'.format(action.startMessage[u'task_uuid']), incident)
