'Test fault serialized to JSON via file-extension and/or header.'

def test_400_fault_json(self):

    requests = [webob.Request.blank('/.json'), webob.Request.blank('/', headers={'Accept': 'application/json'})]
    for request in requests:
        fault = wsgi.Fault(webob.exc.HTTPBadRequest(explanation='scram'))
        response = request.get_response(fault)
        expected = {'badRequest': {'message': 'scram', 'code': http_client.BAD_REQUEST}}
        actual = jsonutils.loads(response.body)
        self.assertEqual('application/json', response.content_type)
        self.assertEqual(expected, actual)
