Skip to content

Commit

Permalink
[IMP] tests imp
Browse files Browse the repository at this point in the history
  • Loading branch information
Volodiay616 committed Nov 7, 2023
1 parent 1192515 commit 9fe5e9e
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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'"
)

0 comments on commit 9fe5e9e

Please sign in to comment.