Merge "Fix test_auth isolation"

This commit is contained in:
Jenkins 2014-01-27 07:40:15 +00:00 committed by Gerrit Code Review
commit 51602dcc25
2 changed files with 7 additions and 6 deletions

View File

@ -20,6 +20,7 @@ from lxml import etree
import six
import webtest
from keystone.auth import controllers as auth_controllers
from keystone.common import serializer
from keystone.openstack.common import jsonutils
from keystone import tests
@ -59,6 +60,9 @@ class RestfulTestCase(tests.TestCase):
def setUp(self, app_conf='keystone'):
super(RestfulTestCase, self).setUp()
# Will need to reset the plug-ins
self.addCleanup(setattr, auth_controllers, 'AUTH_METHODS', {})
self.load_backends()
self.load_fixtures(default_fixtures)

View File

@ -90,9 +90,6 @@ class RestfulTestCase(rest.RestfulTestCase):
#drop the policy rules
self.addCleanup(rules.reset)
# need to reset the plug-ins
self.addCleanup(setattr, auth.controllers, 'AUTH_METHODS', {})
self.addCleanup(self.teardown_database)
def load_backends(self):
@ -344,9 +341,9 @@ class RestfulTestCase(rest.RestfulTestCase):
def v3_request(self, path, **kwargs):
# Check if the caller has passed in auth details for
# use in requesting the token
auth = kwargs.pop('auth', None)
if auth:
token = self.get_requested_token(auth)
auth_arg = kwargs.pop('auth', None)
if auth_arg:
token = self.get_requested_token(auth_arg)
else:
token = kwargs.pop('token', None)
if not token: