From b063479fb38d4a9ed8dbc1de3d08c64885f51bac Mon Sep 17 00:00:00 2001 From: bosd Date: Wed, 1 Nov 2023 22:45:56 +0100 Subject: [PATCH] [IMP] base_business_document_import: test incoterm_match --- .../tests/test_business_document_import.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/base_business_document_import/tests/test_business_document_import.py b/base_business_document_import/tests/test_business_document_import.py index ffcbfaa5655..415608495b7 100644 --- a/base_business_document_import/tests/test_business_document_import.py +++ b/base_business_document_import/tests/test_business_document_import.py @@ -297,3 +297,15 @@ def test_match_account_smaller_in(self): res = bdio._match_account({"code": "898999"}, chatter) self.assertEqual(acc, res) self.assertEqual(len(chatter), 1) + + def test_incoterm_match(self): + bdoo = self.env["business.document.import"] + incoterm_dict = {"code": "EXW"} + res = bdoo._match_incoterm(incoterm_dict, []) + self.assertEquals(res, self.env.ref("account.incoterm_EXW")) + incoterm_dict = {"code": "EXW WORKS"} + res = bdoo._match_incoterm(incoterm_dict, []) + self.assertEquals(res, self.env.ref("account.incoterm_EXW")) + incoterm_dict = {} + res = bdoo._match_incoterm(incoterm_dict, []) + self.assertFalse(res)