Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][PORT] 845 from 14.0: Business_document_import Improve test coverage #849

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ def test_match_shipping_partner(self):
self.assertEqual(res, partner2)

def test_match_currency(self):
currency_inv = self.env.ref("base.EUR")
currency_inv.active = True
bdio = self.env["business.document.import"]
currency_dict = {"xmlid": "base.USD"}
res = bdio._match_currency(currency_dict, [])
Expand Down Expand Up @@ -357,7 +359,6 @@ def test_match_product(self):
raise_test = False
except Exception:
logger.info("Exception catched.")

self.assertTrue(raise_test)

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