Skip to content

Commit

Permalink
[IMP] base_edifact: add unit test for export edifact
Browse files Browse the repository at this point in the history
  • Loading branch information
thienvh332 committed Nov 9, 2023
1 parent e591f27 commit 6f0fafd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions base_edifact/tests/test_base_edifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,20 @@ def test_map2odoo_description(self):
seg = ["F", "79", ["", "", "", "Description"]]
description = self.base_edifact_model.map2odoo_description(seg)
self.assertEqual(description, "Description")

def test_create_segment(self):
segment = self.base_edifact_model.create_segment("DTM", ["171", False, "102"])
self.assertEqual(str(segment), "'DTM' EDI segment: [['171', '', '102']]")

def test_create_interchange(self):
sender_edifact = ["40410", "14"]
recipient_edifact = ["40411", "14"]
control_ref = 10
syntax_identifier = ["UNOC", "3"]
interchange = self.base_edifact_model.create_interchange(
sender_edifact, recipient_edifact, control_ref, syntax_identifier
)
self.assertEqual(interchange.sender, ["40410", "14"])
self.assertEqual(interchange.recipient, ["40411", "14"])
self.assertEqual(interchange.control_reference, "10")
self.assertEqual(interchange.syntax_identifier, ["UNOC", "3"])

0 comments on commit 6f0fafd

Please sign in to comment.