account-closing/account_cutoff_accrual_base/tests/test_account_cutoff.py
2021-03-23 20:28:14 +01:00

29 lines
1.3 KiB
Python

###############################################################################
# For copyright and license notices, see __manifest__.py file in root directory
###############################################################################
from flectra.tests.common import TransactionCase
class TestAccountCutoff(TransactionCase):
def test_inherit_default_cutoff_account_id(self):
company = self.env.user.company_id
default_accrued_expense_account_id = \
company.default_accrued_expense_account_id.id or False
default_accrued_revenue_account_id = \
company.default_accrued_revenue_account_id.id or False
account_id = \
self.env['account.cutoff'].with_context(type='accrued_expense').\
_default_cutoff_account_id()
self.assertEqual(account_id, default_accrued_expense_account_id,
'The account must be equals to %s' %
default_accrued_expense_account_id)
account_id = \
self.env['account.cutoff'].with_context(type='accrued_revenue').\
_default_cutoff_account_id()
self.assertEqual(account_id, default_accrued_revenue_account_id,
'The account must be equals to %s' %
default_accrued_revenue_account_id)