You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
809 B

# -*- coding: utf-8 -*-
# Copyright 2017 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import common
class TestPartnerRiskInsurance(common.SavepointCase):
@classmethod
def setUpClass(cls):
super(TestPartnerRiskInsurance, cls).setUpClass()
cls.partner = cls.env['res.partner'].create({
'name': 'Mr. Odoo',
})
def test_compute_credit(self):
self.partner.company_credit_limit = 1000.0
self.partner.insurance_credit_limit = 3000.0
self.partner._onchage_insurance_credit_limit()
self.assertEqual(self.partner.credit_limit, 4000.0)
# Set credit limit manually:
self.partner.credit_limit = 1500.0
self.assertEqual(self.partner.credit_limit, 1500.0)