test REMOTE_USER does not authenticate

if external (and all other methods) are missing  this test ensures
that  a request with REMOTE_USER set  that the token would come
through as unauthenticated

Change-Id: I08a0117773bd4efd8e220306de7ba82df73f7403
This commit is contained in:
Adam Young 2014-06-19 15:24:02 -04:00
parent d4fe9a6f7a
commit b5576ad69b
1 changed files with 17 additions and 0 deletions

View File

@ -2373,6 +2373,23 @@ class TestAuthJSON(test_v3.RestfulTestCase):
self.post('/auth/tokens', body=auth_data, expected_status=401)
class TestAuthJSONExternal(test_v3.RestfulTestCase):
content_type = 'json'
def config_overrides(self):
self.config_fixture.config(group='auth', methods='')
def test_remote_user_no_method(self):
api = auth.controllers.Auth()
context, auth_info, auth_context = self.build_external_auth_request(
self.default_domain_user['name'])
self.assertRaises(exception.Unauthorized,
api.authenticate,
context,
auth_info,
auth_context)
class TestAuthXML(TestAuthJSON):
content_type = 'xml'