diff options
author | Takashi Natsume <takanattie@gmail.com> | 2022-08-20 13:04:05 +0900 |
---|---|---|
committer | Takashi Natsume <takanattie@gmail.com> | 2022-10-15 12:42:46 +0000 |
commit | 8c94e21196756c0a799dfafb42cbcf4ad96109f6 (patch) | |
tree | dc495ef292b28fab380a2d86f657a10f8f344eb3 /trove/tests/unittests/taskmanager/test_models.py | |
parent | 346e1612200563cdbeadc49186fd819dc6d4f950 (diff) | |
download | trove-8c94e21196756c0a799dfafb42cbcf4ad96109f6.tar.gz |
Fix deprecation warnings
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: I18802ae1e2318eae3c62a26459178b259c728ac4
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Diffstat (limited to 'trove/tests/unittests/taskmanager/test_models.py')
-rw-r--r-- | trove/tests/unittests/taskmanager/test_models.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/trove/tests/unittests/taskmanager/test_models.py b/trove/tests/unittests/taskmanager/test_models.py index 3eb81b8c..4eff71a3 100644 --- a/trove/tests/unittests/taskmanager/test_models.py +++ b/trove/tests/unittests/taskmanager/test_models.py @@ -221,7 +221,7 @@ class BaseFreshInstanceTasksTest(trove_testtools.TestCase): self.freshinstancetasks = taskmanager_models.FreshInstanceTasks( None, MagicMock(), None, None) self.freshinstancetasks.context = trove.common.context.TroveContext( - user='test_user') + user_id='test_user') def tearDown(self): super(BaseFreshInstanceTasksTest, self).tearDown() @@ -1195,16 +1195,16 @@ class RootReportTest(trove_testtools.TestCase): def test_report_root_first_time(self): context = Mock() - context.user = utils.generate_uuid() + context.user_id = utils.generate_uuid() report = mysql_models.RootHistory.create( context, utils.generate_uuid()) self.assertIsNotNone(report) def test_report_root_double_create(self): context = Mock() - context.user = utils.generate_uuid() + context.user_id = utils.generate_uuid() id = utils.generate_uuid() - history = mysql_models.RootHistory(id, context.user).save() + history = mysql_models.RootHistory(id, context.user_id).save() with patch.object(mysql_models.RootHistory, 'load', Mock(return_value=history)): report = mysql_models.RootHistory.create(context, id) @@ -1219,7 +1219,7 @@ class ClusterRootTest(trove_testtools.TestCase): @patch.object(common_models.Root, "create") def test_cluster_root_create(self, root_create, root_history_create): context = Mock() - context.user = utils.generate_uuid() + context.user_id = utils.generate_uuid() id = utils.generate_uuid() password = "rootpassword" cluster_instances = [utils.generate_uuid(), utils.generate_uuid()] |