diff --git a/tacker/tests/unit/test_wsgi.py b/tacker/tests/unit/test_wsgi.py index 4d5f556bd..5071becbb 100644 --- a/tacker/tests/unit/test_wsgi.py +++ b/tacker/tests/unit/test_wsgi.py @@ -616,7 +616,7 @@ class ResourceTest(base.BaseTestCase): resource = wsgi.Resource(Controller(), my_fault_body_function) request = FakeRequest() result = resource(request) - self.assertEqual(400, result.status_int) + self.assertEqual(415, result.status_int) def test_type_error(self): class Controller(object): diff --git a/tacker/wsgi.py b/tacker/wsgi.py index 665f38252..f81d98ab3 100644 --- a/tacker/wsgi.py +++ b/tacker/wsgi.py @@ -787,7 +787,7 @@ class Resource(Application): action, args, accept = self.deserializer.deserialize(request) except exception.InvalidContentType: LOG.exception("InvalidContentType: Unsupported Content-Type") - return Fault(webob.exc.HTTPBadRequest( + return Fault(webob.exc.HTTPUnsupportedMediaType( explanation=_("Unsupported Content-Type"))) except exception.MalformedRequestBody: LOG.exception("MalformedRequestBody: Malformed request body")