Skip to content

Commit

Permalink
[IMP] maintenance_request_repair: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kaynnan committed Mar 21, 2023
1 parent 2b6420f commit 25469b0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions maintenance_request_repair/tests/test_repair_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def setUp(self):

self.request1 = self.env["maintenance.request"].create({"name": "Request 1"})
self.request2 = self.env["maintenance.request"].create({"name": "Request 2"})
self.request3 = self.env["maintenance.request"].create({"name": "Request 3"})
self.repair_order.maintenance_request_ids += self.request1
self.repair_order.maintenance_request_ids += self.request2

Expand Down Expand Up @@ -75,3 +76,13 @@ def test_action_view_maintenance_request(self):
self.action_result = self.repair_order.action_view_maintenance_request()
self.assertTrue("views" in self.action_result)
self.assertTrue("res_id" in self.action_result)

self.repair_order.maintenance_request_ids = self.request3
self.action_result = self.repair_order.action_view_maintenance_request()
if len(self.action_result["views"]) == 1:
self.assertEqual(self.action_result["views"][0][1], "form")
self.assertEqual(self.action_result["res_id"], self.request3.id)
else:
self.assertEqual(len(self.action_result["views"]), 6)
self.assertEqual(self.action_result["views"][0][1], "form")
self.assertEqual(self.action_result["views"][1][1], "kanban")

0 comments on commit 25469b0

Please sign in to comment.