Skip to content

Commit

Permalink
[IMP] base_business_document_import: test incoterm_match
Browse files Browse the repository at this point in the history
  • Loading branch information
bosd committed Jul 15, 2024
1 parent 3da15e0 commit 49fcaed
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from odoo.tests import tagged
from odoo.tests.common import TransactionCase

_logger = logging.getLogger("odoo.tests.test_module_operations")
logger = logging.getLogger(__name__)


@tagged("post_install", "-at_install")
Expand Down Expand Up @@ -173,8 +173,8 @@ def test_match_product(self):
try:
bdio._match_product(product_dict, [], seller=False)
raise_test = False
except Exception as e:
_logger.info(e)
except Exception:
logger.info("Exception catched.")
self.assertTrue(raise_test)

def test_match_uom(self):
Expand Down Expand Up @@ -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)

0 comments on commit 49fcaed

Please sign in to comment.