Skip to content

Commit

Permalink
[IMP] Improve code coverage by testing onchange with draft records
Browse files Browse the repository at this point in the history
  • Loading branch information
aisopuro committed Oct 30, 2023
1 parent a8058c3 commit d49b5f3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions l10n_fi_business_code/tests/test_partner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from odoo.tests.common import TransactionCase
from odoo.tests import Form


class TestPartner(TransactionCase):
Expand Down Expand Up @@ -26,3 +27,12 @@ def test_partner_same_business_code(self):
)

self.assertIs(len(self.partner2.same_business_code_partner_id), 1)

draft_partner = Form(self.env["res.partner"])
draft_partner.name = "Test Company 3"
draft_partner.business_code = "1234567-1"
self.assertEqual(
draft_partner.same_business_code_partner_id,
self.partner1 + self.partner2,
msg="Duplicate code calculation should also work while in draft",
)

0 comments on commit d49b5f3

Please sign in to comment.