From 9fe5e9ede96e19c6a804cf7841198985ce2ee9c8 Mon Sep 17 00:00:00 2001 From: Volodiay616 <108336612+Volodiay616@users.noreply.github.com> Date: Tue, 7 Nov 2023 15:16:07 -0600 Subject: [PATCH] [IMP] tests imp --- .../test_project_task_pull_request_state.py | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/project_task_pull_request_state/tests/test_project_task_pull_request_state.py b/project_task_pull_request_state/tests/test_project_task_pull_request_state.py index 5066d5b961..6a4be42c7c 100644 --- a/project_task_pull_request_state/tests/test_project_task_pull_request_state.py +++ b/project_task_pull_request_state/tests/test_project_task_pull_request_state.py @@ -128,9 +128,6 @@ def test_multi_create(self): self.assertEqual(test_tasks[0].pr_state, "draft", "PR state must be 'draft") self.assertEqual(test_tasks[1].pr_state, "open", "PR state must be 'open") self.assertEqual(test_tasks[2].pr_state, "closed", "PR state must be 'closed") - # Set empty values - self.env["res.config.settings"].set_values() - self.assertFalse(test_tasks[2].pr_state, "PR state must be False") def test_set_pr_state(self): """Test _set_pr_state function""" @@ -158,3 +155,21 @@ def test_set_pr_state(self): } ) self.assertEqual(test_task.pr_state, "closed", "PR state must be 'closed") + + def test_set_pr_state_default(self): + """Set values for the pr_state_default parameter""" + config_settings = self.env["res.config.settings"].create({}) + + # Set the pr_state_default field value + config_settings.pr_state_default = "open" + + # Call the set_values method to update the parameter + config_settings.set_values() + + # Verify that the parameter has been set to the desired value + pr_state_default_param = self.env["ir.config_parameter"].get_param( + "project_task_pull_request_state.pr_state_default" + ) + self.assertEqual( + pr_state_default_param, "open", "PR state default parameter must be 'open'" + )