Skip to content

Commit

Permalink
[FIX] task duplication test
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocorato committed Oct 30, 2023
1 parent d02846b commit bdcb359
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ def _create_sale_order_with_project(self):
self.assertEqual(len(project), 1, msg="Project was not created")

def test_01_order_create_task(self):
task_type_new_id = self.env["project.task.type"].search([("name", "=", "New")])
self.assertEqual(len(task_type_new_id), 1)
actual_task_type_new_ids = self.env["project.task.type"].search(
[("name", "=", "New")]
)
actual_new_state_number = len(actual_task_type_new_ids)
self._create_sale_order_with_project()
# create another sale order with project
self._create_sale_order_with_project()
task_type_new_id = self.env["project.task.type"].search([("name", "=", "New")])
self.assertEqual(len(task_type_new_id), 1)
task_type_new_ids = self.env["project.task.type"].search([("name", "=", "New")])
# check no New task type are created in addition to the existing ones
self.assertEqual(len(task_type_new_ids), actual_new_state_number)

0 comments on commit bdcb359

Please sign in to comment.