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: ...@@ -32,11 +32,10 @@ class Account:
""" """
_properties = ( _properties = (
{ 'id' : 'is_credit_account', # XXX: this property should be { 'id' : 'credit_account',
# named diferently : an account can 'storage_id' : 'is_credit_account',
# be naturally debitor, creditor, 'description' : 'Set to true if this account have a normal balance of'\
# or none of those ' debit.',
'description' : 'Some accounts are',
'type' : 'boolean', 'type' : 'boolean',
'mode' : 'w' , 'mode' : 'w' ,
'default' : 0 }, 'default' : 0 },
......
...@@ -1318,6 +1318,21 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -1318,6 +1318,21 @@ class TestAccounting(ERP5TypeTestCase):
self.assertRaises(ValidationFailed, self.getWorkflowTool().doActionFor, self.assertRaises(ValidationFailed, self.getWorkflowTool().doActionFor,
transaction, 'stop_action') 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__': if __name__ == '__main__':
framework() framework()
else: 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