Skip to content

Commit

Permalink
Test for content-type appropriate 404 (bug 1089987)
Browse files Browse the repository at this point in the history
Change-Id: Idfba75f90e38de315ec50e660932beb8243f76f8
  • Loading branch information
dolph committed Dec 14, 2012
1 parent 4e2be8a commit be3dcf9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion keystone/common/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions tests/test_content_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit be3dcf9

Please sign in to comment.