Commit 0fea3a5a authored by Jérome Perrin's avatar Jérome Perrin

'is_credit_account' was a bad property name, change it to 'credit_account'.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10909 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dd173f79
......@@ -32,11 +32,10 @@ class Account:
"""
_properties = (
{ 'id' : 'is_credit_account', # XXX: this property should be
# named diferently : an account can
# be naturally debitor, creditor,
# or none of those
'description' : 'Some accounts are',
{ 'id' : 'credit_account',
'storage_id' : 'is_credit_account',
'description' : 'Set to true if this account have a normal balance of'\
' debit.',
'type' : 'boolean',
'mode' : 'w' ,
'default' : 0 },
......
......@@ -1318,6 +1318,21 @@ class TestAccounting(ERP5TypeTestCase):
self.assertRaises(ValidationFailed, self.getWorkflowTool().doActionFor,
transaction, 'stop_action')
def test_Account_isCreditAccount(self):
"""Tests the 'credit_account' property on account, which was named
is_credit_account, which generated isIsCreditAccount accessor"""
account = self.getAccountModule().newContent(portal_type='Account')
# simulate an old object
account.is_credit_account = True
account.setCreditAccount(True)
self.failUnless(account.isCreditAccount())
# this is what Account_view would do when you update the code before
# without updating business template.
account.edit(is_credit_account=False)
self.failIf(account.isCreditAccount())
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