From a641b2508de41046666fff8f4d1e7a65aa80b1fe Mon Sep 17 00:00:00 2001 From: Takashi Natsume Date: Sat, 13 Aug 2022 17:03:32 +0900 Subject: [PATCH] Fix deprecation warnings about oslo.context Fix the following deprecation warnings. DeprecationWarning: Using the 'user' argument is deprecated in version '2.18' and will be removed in version '3.0', please use the 'user_id' argument instead DeprecationWarning: Property 'user' has moved to 'user_id' in version '2.6' and will be removed in version '3.0' Change-Id: I3bda1f744f41ce82c4c3f2a4c9fc31582cce2253 Closes-Bug: 1986418 Signed-off-by: Takashi Natsume --- neutron/tests/unit/test_auth.py | 1 - neutron/tests/unit/test_policy.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/neutron/tests/unit/test_auth.py b/neutron/tests/unit/test_auth.py index ef30a0a226f..bd0de5c830c 100644 --- a/neutron/tests/unit/test_auth.py +++ b/neutron/tests/unit/test_auth.py @@ -45,7 +45,6 @@ class NeutronKeystoneContextTestCase(base.BaseTestCase): response = self.request.get_response(self.middleware) self.assertEqual('200 OK', response.status) self.assertEqual('testuserid', self.context.user_id) - self.assertEqual('testuserid', self.context.user) def test_with_tenant_id(self): self.request.headers['X_PROJECT_ID'] = 'testtenantid' diff --git a/neutron/tests/unit/test_policy.py b/neutron/tests/unit/test_policy.py index c55485a96f8..a841c46ab50 100644 --- a/neutron/tests/unit/test_policy.py +++ b/neutron/tests/unit/test_policy.py @@ -227,7 +227,7 @@ class PolicyTestCase(base.BaseTestCase): action = "get_example:only_project_user_allowed" target = {'project_id': 'some-project'} system_admin_ctx = context.Context( - user="fake", + user_id="fake", roles=['admin', 'member', 'reader'], system_scope='all') self.assertRaises(