Commit 784a8b48 authored by Jérome Perrin's avatar Jérome Perrin

test for M9 GAP / AccountType consistency checker



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10216 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 63e80fa3
......@@ -173,6 +173,51 @@ class TestAccounting_l10n_M9(ERP5TypeTestCase):
self.assertRaises(ValidationFailed, self.getWorkflowTool().doActionFor,
transmission_sheet, 'emit_action')
def test_AccountTypeConstaintForExpense(self):
account = self._getAccount('account',
gap='fr/m9/6/60/602/6022/60225',
account_type='expense')
self.assertEquals([], account.checkConsistency())
def test_AccountTypeConstaintFixForExpense(self):
account = self._getAccount('account',
gap='fr/m9/6/60/602/6022/60225',
account_type='equity')
self.assertEquals(1, len(account.checkConsistency(fixit=1)))
self.assertEquals('expense', account.getAccountType())
def test_AccountTypeConstaintForPayable(self):
account = self._getAccount('payable_account',
gap='fr/m9/4/40',
account_type='liability/payable')
self.assertEquals([], account.checkConsistency())
def test_AccountTypeConstaintFixForPayable(self):
account = self._getAccount('payable_account',
gap='fr/m9/4/40',
account_type='equity')
self.assertEquals(1, len(account.checkConsistency(fixit=1)))
self.assertEquals('liability/payable', account.getAccountType())
def test_AccountTypeConstaintForClass4(self):
# members of class 4 can be payable or receivable
account = self._getAccount('class4_account',
gap='fr/m9/4/44',
account_type='liability/payable')
self.assertEquals([], account.checkConsistency())
account.edit(account_type='asset/receivable')
self.assertEquals([], account.checkConsistency())
def test_AccountTypeConstaintFixForClass4(self):
# members of class 4 can be payable or receivable
account = self._getAccount('class4_account',
gap='fr/m9/4/44',
account_type='equity')
self.assertEquals(1, len(account.checkConsistency(fixit=1)))
self.failUnless(account.getAccountType() in ('liability/payable',
'asset/receivable'))
if __name__ == '__main__':
framework()
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment