From e23929cd98dedeffee809194088c42d926ebba72 Mon Sep 17 00:00:00 2001 From: bosd Date: Wed, 1 Nov 2023 22:45:56 +0100 Subject: [PATCH] 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 9581bad05db..5d034077978 100644 --- a/base_business_document_import/tests/test_business_document_import.py +++ b/base_business_document_import/tests/test_business_document_import.py @@ -481,3 +481,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.assertEqual(res, self.env.ref("account.incoterm_EXW")) + incoterm_dict = {"code": "EXW WORKS"} + res = bdoo._match_incoterm(incoterm_dict, []) + self.assertEqual(res, self.env.ref("account.incoterm_EXW")) + incoterm_dict = {} + res = bdoo._match_incoterm(incoterm_dict, []) + self.assertFalse(res)