From 8fe7c419ae1a6facd6ea3255cb660c81f327ba8f Mon Sep 17 00:00:00 2001 From: rf-ife Date: Fri, 8 Nov 2024 19:00:03 +0100 Subject: [PATCH] fix test function --- .../test_maintenance_equipment_sequence.py | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/maintenance_equipment_sequence/tests/test_maintenance_equipment_sequence.py b/maintenance_equipment_sequence/tests/test_maintenance_equipment_sequence.py index 46396dcc0..910a24ccb 100644 --- a/maintenance_equipment_sequence/tests/test_maintenance_equipment_sequence.py +++ b/maintenance_equipment_sequence/tests/test_maintenance_equipment_sequence.py @@ -19,15 +19,32 @@ def test_01_maintenance_equipment_sequence(self): sequence number has been set """ # Create category + seq_0 = self.sequence_obj.create( + { + "name": "Test Sequence", + "implementation": "no_gap", + "prefix": "TTC_TEST", + "padding": 4, + "number_increment": 1, + "use_date_range": False, + "sequence_number_next": 1, + } + ) + categ_0 = self.maintenance_equipment_categ_obj.create( + { + "name": "Test Category 0", + "sequence_id": seq_0.id, + } + ) + self.assertEqual(categ_0.sequence_prefix, seq_0.prefix) + categ_1 = self.maintenance_equipment_categ_obj.create( - [ - { - "name": "Test Category", - "sequence_prefix": "TTC", - "sequence_number_next": 1, - } - ] - )[0] + { + "name": "Test Category", + "sequence_prefix": "TTC", + "sequence_number_next": 1, + } + ) seq_1 = self.sequence_obj.search( [("name", "=", categ_1.name), ("prefix", "=", "TTC")], limit=1 )