Skip to content

Commit

Permalink
Improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
RPSJR committed Oct 28, 2024
1 parent 43776df commit e6c03f2
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ def setUpClass(cls):
(
0,
0,
{"inspection_template_item_id": cls.item_01.id},
{"inspection_template_item_id": cls.item_01.id,
"sequence": 13 # Different sequence in the template line
},
),
(
0,
0,
{"inspection_template_item_id": cls.item_02.id},
{"inspection_template_item_id": cls.item_02.id,
},
),
],
}
Expand All @@ -43,7 +46,17 @@ def setUpClass(cls):
)

def test_fleet_vehicle_inspection(self):

self.inspection._onchange_inspection_template_id()

# Existing assertions
self.assertEqual(self.inspection.name, self.inspection_template.name)
self.assertTrue(self.inspection.inspection_line_ids)

# New assertions for sequence
self.assertEqual(len(self.inspection.inspection_line_ids), 2)

# Check if the sequence is correctly copied from the template line
line_1 = self.inspection.inspection_line_ids.filtered(
lambda l: l.inspection_item_id == self.item_01
)
self.assertEqual(line_1.sequence, 13)

0 comments on commit e6c03f2

Please sign in to comment.