Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test for content-type appropriate 404 (bug 1089987)

Change-Id: Idfba75f90e38de315ec50e660932beb8243f76f8
  • Loading branch information...
commit be3dcf9873fb84bbb5c2cd3ed8f36444f353757e 1 parent 4e2be8a
@dolph dolph authored
Showing with 13 additions and 1 deletion.
  1. +1 −1  keystone/common/wsgi.py
  2. +12 −0 tests/test_content_types.py
View
2  keystone/common/wsgi.py
@@ -427,7 +427,7 @@ def _dispatch(req):
match = req.environ['wsgiorg.routing_args'][1]
if not match:
return render_exception(
- exception.NotFound(message='The resource could not be found.'))
+ exception.NotFound(_('The resource could not be found.')))
app = match['controller']
return app
View
12 tests/test_content_types.py
@@ -308,6 +308,18 @@ def assertValidRole(self, tenant):
self.assertIsNotNone(tenant.get('id'))
self.assertIsNotNone(tenant.get('name'))
+ def test_public_not_found(self):
+ r = self.public_request(
+ path='/%s' % uuid.uuid4().hex,
+ expected_status=404)
+ self.assertValidErrorResponse(r)
+
+ def test_admin_not_found(self):
+ r = self.admin_request(
+ path='/%s' % uuid.uuid4().hex,
+ expected_status=404)
+ self.assertValidErrorResponse(r)
+
def test_public_multiple_choice(self):
r = self.public_request(path='/', expected_status=300)
self.assertValidMultipleChoiceResponse(r)
Please sign in to comment.
Something went wrong with that request. Please try again.