Commit 22a97a18 authored by Tomáš Peterka's avatar Tomáš Peterka

[accounting_ui_test] Tests are independent

parent 38ba0fc7
...@@ -13,15 +13,6 @@ business_process = portal.portal_catalog.getResultValue( ...@@ -13,15 +13,6 @@ business_process = portal.portal_catalog.getResultValue(
'erp5_default_business_process'), # erp5_simulation_test 'erp5_default_business_process'), # erp5_simulation_test
portal_type='Business Process').getRelativeUrl() portal_type='Business Process').getRelativeUrl()
# if the previous test didn't change input data, no need to recreate content
current_script_data_id = '%s_month_count_%s_draft_%s_state_%s_payment_%s_leger_%s' % (
month_count, add_draft_transactions, transaction_state,
add_related_payments, set_ledger, script.getId())
if accounting_module.getProperty('current_content_script',
'') == current_script_data_id:
return "Accounting Transactions Created."
# first, cleanup accounting module # first, cleanup accounting module
# XXX should be done in an external script / tool, because we have to # XXX should be done in an external script / tool, because we have to
# workaround some security checks # workaround some security checks
...@@ -280,9 +271,6 @@ if add_draft_transactions: ...@@ -280,9 +271,6 @@ if add_draft_transactions:
source=getAccountByTitle('Goods Sales'), source=getAccountByTitle('Goods Sales'),
quantity=random.randint(300, 400),) quantity=random.randint(300, 400),)
accounting_module.setProperty('current_content_script',
current_script_data_id)
# test depends on this # test depends on this
return "Accounting Transactions Created." return "Accounting Transactions Created."
# vim: syntax=python # vim: syntax=python
...@@ -10,13 +10,6 @@ year = 2005 ...@@ -10,13 +10,6 @@ year = 2005
total_receivable_quantity = 0 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())
if accounting_module.getProperty('current_content_script',
'') == current_script_data_id:
return "Accounting Transactions Created."
# first, cleanup accounting module # first, cleanup accounting module
# XXX should be done in an external script / tool, because we have to # XXX should be done in an external script / tool, because we have to
# workaround some security checks # workaround some security checks
...@@ -127,10 +120,6 @@ for month in range(1, month_count + 1): ...@@ -127,10 +120,6 @@ for month in range(1, month_count + 1):
'immediateReindexObject')), 'immediateReindexObject')),
).AccountingTransactionLine_resetGroupingReference() ).AccountingTransactionLine_resetGroupingReference()
accounting_module.setProperty('current_content_script',
current_script_data_id)
# test depends on this # test depends on this
return "Accounting Transactions Created." return "Accounting Transactions Created."
# vim: syntax=python # vim: syntax=python
...@@ -7,13 +7,6 @@ from DateTime import DateTime ...@@ -7,13 +7,6 @@ from DateTime import DateTime
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery from Products.ZSQLCatalog.SQLCatalog import SimpleQuery
year = 2005 year = 2005
# 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())
if accounting_module.getProperty('current_content_script',
'') == current_script_data_id:
return "Accounting Transactions Created."
# first, cleanup accounting module # first, cleanup accounting module
# XXX should be done in an external script / tool, because we have to # XXX should be done in an external script / tool, because we have to
...@@ -99,8 +92,6 @@ for month in range(1, month_count + 1): ...@@ -99,8 +92,6 @@ for month in range(1, month_count + 1):
tr.setSourceReference('source_reference') tr.setSourceReference('source_reference')
tr.setDestinationReference('destination_reference') tr.setDestinationReference('destination_reference')
accounting_module.setProperty('current_content_script',
current_script_data_id)
# test depends on this # test depends on this
return "Accounting Transactions Created." return "Accounting Transactions Created."
......
...@@ -3,7 +3,5 @@ module = portal.accounting_module ...@@ -3,7 +3,5 @@ module = portal.accounting_module
module.manage_delObjects(list(module.objectIds())) module.manage_delObjects(list(module.objectIds()))
module.setProperty('current_content_script', script.getId())
# test depends on this # test depends on this
return "Accounting Transactions Created." return "Accounting Transactions Created."
"""Change the `current_content_script` property on accounting module, """Change the `current_content_script` property on accounting module,
so that the next test knows that we have modified the test data. so that the next test knows that we have modified the test data.
XXX Kato: This is seriously wrong because test must not suppose anything
about the other tests - especially that they did not modify the data.
""" """
context.getPortalObject().accounting_module.setProperty( context.getPortalObject().accounting_module.setProperty(
'current_content_script', 'modified') 'current_content_script', 'modified')
......
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