'Ensure that the [keystone_authtoken] section is used.
Ensure that the [keystone_authtoken] section of the configuration
is used when the auth_uri is not defined in the context or the
[clients_keystone] section.'

def test_keystone_v3_endpoint_in_keystone_authtoken_config(self):

    importutils.import_module('keystonemiddleware.auth_token')
    cfg.CONF.set_override('auth_uri', 'http://abc/v2.0', group='keystone_authtoken')
    policy_check = 'heat.common.policy.Enforcer.check_is_admin'
    with mock.patch(policy_check) as pc:
        pc.return_value = False
        ctx = context.RequestContext(auth_url=None)
        self.assertEqual(ctx.keystone_v3_endpoint, 'http://abc/v3')
