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

accounting_ui_test: fix pylint issues

and re-enable coding style test
parent 8ff42a5b
Pipeline #7107 failed with stage
in 0 seconds
......@@ -8,7 +8,6 @@ from DateTime import DateTime
portal = context.getPortalObject()
person_module = portal.person_module
accounting_module = portal.accounting_module
account_module = portal.account_module
organisation_module = portal.organisation_module
......
from DateTime import DateTime
portal = context.getPortalObject()
accounting_module = portal.accounting_module
account_module = portal.account_module
one_hour = 1.0 / 24.0
......
......@@ -41,10 +41,9 @@ for accounting_type_id in portal.getPortalAccountingTransactionTypeList():
ledger_value_list=list(portal.portal_categories.ledger.test_accounting.contentValues())
if set_ledger else ())
test_ledger_1 = test_ledger_2 = None
test_ledger_1 = None
if set_ledger:
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):
account_list = [x.getObject().getRelativeUrl() for x in
......@@ -65,13 +64,6 @@ section = getOrganisationByTitle(section_title)
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(
portal_type='Product',
......@@ -82,7 +74,7 @@ else:
product = portal.product_module.newContent(portal_type='Product',
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(
portal_type='Sale Packing List',
title='Dummy Packing List for testing',
......@@ -211,7 +203,7 @@ for month in range(1, month_count + 1):
for line in payment.getMovementList(
portal_type=payment.getPortalAccountingMovementTypeList()):
if line.getGroupingReference():
line.activate(after_tag=tag).AccountingTransactionLine_resetGroupingReference()
line.activate(after_tag=tag).AccountingTransactionLine_resetGroupingReference()
else:
# other cases not supported for now
......
......@@ -8,8 +8,6 @@ portal = context.getPortalObject()
accounting_module = portal.accounting_module
year = 2005
total_receivable_quantity = 0
# if the previous test didn't change input data, no need to recreate content
current_script_data_id = '%s_month_count_%s' % (
month_count, script.getId())
......@@ -75,7 +73,6 @@ for month in range(1, month_count + 1):
specialise=business_process,
)
receivable_qty = -(amount * (1 + vat_rate))
total_receivable_quantity += receivable_qty
tr.newContent(portal_type='Sale Invoice Transaction Line',
source=getAccountByTitle('Receivable'),
destination=getAccountByTitle('Payable'),
......@@ -123,7 +120,7 @@ for month in range(1, month_count + 1):
for line in ptr.getMovementList(
portal_type=ptr.getPortalAccountingMovementTypeList()):
if line.getGroupingReference():
line.activate(after_tag=tag).AccountingTransactionLine_resetGroupingReference()
line.activate(after_tag=tag).AccountingTransactionLine_resetGroupingReference()
accounting_module.setProperty('current_content_script',
......
......@@ -60,14 +60,6 @@ def getCurrencyByReference(reference):
return document_list[0]
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):
day = 1
vat_rate = .1
......
Functional test suites for erp5_accounting.
Functional test suites for erp5_accounting.
Contains sample data as path items that may overwrite your existing data. Use at your own risks.
\ No newline at end of file
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