Commit a1a9bfe8 authored by Jérome Perrin's avatar Jérome Perrin

accounting_ui_test: fix pylint issues

and re-enable coding style test
parent e0c2f7a2
...@@ -8,7 +8,6 @@ from DateTime import DateTime ...@@ -8,7 +8,6 @@ from DateTime import DateTime
portal = context.getPortalObject() portal = context.getPortalObject()
person_module = portal.person_module person_module = portal.person_module
accounting_module = portal.accounting_module
account_module = portal.account_module account_module = portal.account_module
organisation_module = portal.organisation_module organisation_module = portal.organisation_module
......
from DateTime import DateTime from DateTime import DateTime
portal = context.getPortalObject() portal = context.getPortalObject()
accounting_module = portal.accounting_module
account_module = portal.account_module account_module = portal.account_module
one_hour = 1.0 / 24.0 one_hour = 1.0 / 24.0
......
...@@ -41,10 +41,9 @@ for accounting_type_id in portal.getPortalAccountingTransactionTypeList(): ...@@ -41,10 +41,9 @@ for accounting_type_id in portal.getPortalAccountingTransactionTypeList():
ledger_value_list=list(portal.portal_categories.ledger.test_accounting.contentValues()) ledger_value_list=list(portal.portal_categories.ledger.test_accounting.contentValues())
if set_ledger else ()) if set_ledger else ())
test_ledger_1 = test_ledger_2 = None test_ledger_1 = None
if set_ledger: if set_ledger:
test_ledger_1 = portal.portal_categories.ledger.test_accounting.test_ledger_1 test_ledger_1 = portal.portal_categories.ledger.test_accounting.test_ledger_1
test_ledger_2 = portal.portal_categories.ledger.test_accounting.test_ledger_2
def getAccountByTitle(title): def getAccountByTitle(title):
account_list = [x.getObject().getRelativeUrl() for x in account_list = [x.getObject().getRelativeUrl() for x in
...@@ -65,13 +64,6 @@ section = getOrganisationByTitle(section_title) ...@@ -65,13 +64,6 @@ section = getOrganisationByTitle(section_title)
euro_resource = 'currency_module/euro' euro_resource = 'currency_module/euro'
def getBankAccountByTitle(title):
document_list = [x.getObject().getRelativeUrl() for x in
portal.portal_catalog(portal_type='Bank Account',
title=SimpleQuery(title=title, comparison_operator='='))]
assert len(document_list) == 1, \
'%d Bank Account with title "%s"' % (len(document_list), title)
return document_list[0]
product_list = [o.getObject() for o in portal.portal_catalog( product_list = [o.getObject() for o in portal.portal_catalog(
portal_type='Product', portal_type='Product',
...@@ -82,7 +74,7 @@ else: ...@@ -82,7 +74,7 @@ else:
product = portal.product_module.newContent(portal_type='Product', product = portal.product_module.newContent(portal_type='Product',
title='Dummy Product for testing') title='Dummy Product for testing')
for i in range(random.randint(5, 10)): for _ in range(random.randint(5, 10)):
pl = portal.sale_packing_list_module.newContent( pl = portal.sale_packing_list_module.newContent(
portal_type='Sale Packing List', portal_type='Sale Packing List',
title='Dummy Packing List for testing', title='Dummy Packing List for testing',
......
...@@ -8,8 +8,6 @@ portal = context.getPortalObject() ...@@ -8,8 +8,6 @@ portal = context.getPortalObject()
accounting_module = portal.accounting_module accounting_module = portal.accounting_module
year = 2005 year = 2005
total_receivable_quantity = 0
# if the previous test didn't change input data, no need to recreate content # if the previous test didn't change input data, no need to recreate content
current_script_data_id = '%s_month_count_%s' % ( current_script_data_id = '%s_month_count_%s' % (
month_count, script.getId()) month_count, script.getId())
...@@ -75,7 +73,6 @@ for month in range(1, month_count + 1): ...@@ -75,7 +73,6 @@ for month in range(1, month_count + 1):
specialise=business_process, specialise=business_process,
) )
receivable_qty = -(amount * (1 + vat_rate)) receivable_qty = -(amount * (1 + vat_rate))
total_receivable_quantity += receivable_qty
tr.newContent(portal_type='Sale Invoice Transaction Line', tr.newContent(portal_type='Sale Invoice Transaction Line',
source=getAccountByTitle('Receivable'), source=getAccountByTitle('Receivable'),
destination=getAccountByTitle('Payable'), destination=getAccountByTitle('Payable'),
......
...@@ -60,14 +60,6 @@ def getCurrencyByReference(reference): ...@@ -60,14 +60,6 @@ def getCurrencyByReference(reference):
return document_list[0] return document_list[0]
euro_resource = getCurrencyByReference('EUR') euro_resource = getCurrencyByReference('EUR')
def getBankAccountByTitle(title):
document_list = [x.getObject().getRelativeUrl() for x in
portal.portal_catalog(portal_type='Bank Account',
title=SimpleQuery(title=title, comparison_operator='='))]
assert len(document_list) == 1, \
'%d Bank Account with title "%s"' % (len(document_list), title)
return document_list[0]
for month in range(1, month_count + 1): for month in range(1, month_count + 1):
day = 1 day = 1
vat_rate = .1 vat_rate = .1
......
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