'If the decorated function raises L{BadRequest} then the generated
response:
- has the code taken from the exception.
- has a I{Content-Type} header set to I{application/json}.
- has a JSON-encoded body indicating an error response and giving
details from the exception.'

@validateLogging(_assertRequestLogged('/foo/badrequest'))
def test_badRequestRaised(self, logger):

    application = self.application(logger, {})
    request = dummyRequest('GET', '/foo/badrequest', Headers(), '')
    self.render(application.app.resource(), request)
    expected = CloseEnoughJSONResponse(application.BAD_REQUEST_CODE, Headers({'content-type': ['application/json']}), application.BAD_REQUEST_RESULT)
    return expected.verify(asResponse(request))
