From 040a7f5c41461338bfd71f38f0bf7d244712bde3 Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Mon, 19 May 2025 19:11:23 +0100 Subject: [PATCH] update tests for new oslo.context release context.user has been deprecated for years and renamed to user_id the deprecated field has now been removed so this change updates our test cases to reflect that. Change-Id: I120441fb9392c370c57dc63d8c115d8993d25f62 --- watcher/tests/objects/test_objects.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/watcher/tests/objects/test_objects.py b/watcher/tests/objects/test_objects.py index 5b65c411e..a2511abab 100644 --- a/watcher/tests/objects/test_objects.py +++ b/watcher/tests/objects/test_objects.py @@ -55,7 +55,7 @@ class MyObj(base.WatcherPersistentObject, base.WatcherObject, @object_base.remotable def update_test(self, context=None): - if context and context.user == 'alternate': + if context and context.user_id == 'alternate': self.bar = 'alternate-context' else: self.bar = 'updated' @@ -209,7 +209,7 @@ class _TestObject(object): def test_with_alternate_context(self): ctxt1 = context.RequestContext('foo', 'foo') - ctxt2 = context.RequestContext(user='alternate') + ctxt2 = context.RequestContext(user_id='alternate') obj = MyObj.query(ctxt1) obj.update_test(ctxt2) self.assertEqual('alternate-context', obj.bar)