Commit 132a0535 authored by Jérome Perrin's avatar Jérome Perrin

Add tests for grouping reference fast input

AccountingZuite_createAccountingTransactionList: add a parameter to create payments related to sale invoices
AccountingZuite_reset : clear selection used in grouping reference fast input

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19666 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 731f6b43
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="Zuite" module="Products.Zelenium.zuite"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test_grouping_reference</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<html>\n
<head><title>Grouping from account transactions view</title></head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="4">\n
Grouping from account transaction view\n
</td></tr>\n
</thead><tbody tal:define="init_method string:AccountingZuite_createAccountingTransactionList?add_draft_transactions:int=0&add_related_payments:int=1">\n
\n
<!-- Setup {{{ -->\n
<tal:block metal:use-macro="here/AccountingZuite_CommonTemplate/macros/init"/>\n
<tr>\n
<td>selectAndWait</td>\n
<td>select_module</td>\n
<td>Accounts</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>Folder_show:method</td>\n
<td></td>\n
</tr>\n
<!-- }}} -->\n
\n
<!-- {{{ Select Receivable account and use grouping fast input -->\n
<tr>\n
<td>clickAndWait</td>\n
<td>link=Receivable</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//img[@alt=\'Grouping Reference Fast Input\']</td>\n
<td></td>\n
</tr>\n
\n
<!-- switch on the \'your_grouping\' flag -->\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>off</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>field_your_grouping</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_update_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Updated</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>on</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//fieldset[2]/div/div/span</td>\n
<td>0.00</td>\n
</tr>\n
<tr>\n
<td>verifySelectedLabel</td>\n
<td>field_your_node</td>\n
<td>41 - Receivable</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//span[@id=\'listbox_record_number\']</td>\n
<td>4 record(s)</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//tr[@id=\'listbox_data_line_3\']/td[1]/input</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_update_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Updated</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//fieldset[2]/div/div/span</td>\n
<td>2 200.00</td>\n
</tr>\n
\n
<!-- Not possible to group for now -->\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_submit_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Nothing matches</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//fieldset[2]/div/div/span</td>\n
<td>2 200.00</td>\n
</tr>\n
\n
<!-- select one more -->\n
<tr>\n
<td>click</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[1]/input</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_update_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Updated</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//fieldset[2]/div/div/span</td>\n
<td>0.00</td>\n
</tr>\n
\n
<!-- selected amount is 0, so it will be possible to validate -->\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_submit_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>2 Lines Grouped</td>\n
<td></td>\n
</tr>\n
\n
<!-- mark the module as changed, reindex and come back to the account -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/AccountingZuite_markChanged</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>open</td>\n
<td>${base_url}</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>selectAndWait</td>\n
<td>select_module</td>\n
<td>Accounts</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>link=Receivable</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//img[@alt=\'Grouping Reference Fast Input\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<!-- switch off the \'your_grouping\' flag, to see grouped lines, and ungroup\n
them -->\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>on</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>field_your_grouping</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_update_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Updated</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>off</td>\n
</tr>\n
\n
<tr>\n
<td>verifySelectedLabel</td>\n
<td>field_your_node</td>\n
<td>41 - Receivable</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//span[@id=\'listbox_record_number\']</td>\n
<td>2 record(s)</td>\n
</tr>\n
<tr>\n
<td>assertElementPresent</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[6]/a/text()</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertElementPresent</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[6]/a/text()</td>\n
<td></td>\n
</tr>\n
\n
<!-- now try to ungroup with only one, it should be refused -->\n
<tr>\n
<td>click</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[1]/input</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_submit_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Ungrouping refused. Check your selection</td>\n
<td></td>\n
</tr>\n
\n
<!-- check all and try to ungroup again -->\n
<tr>\n
<td>click</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[1]/input</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_submit_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>2 Lines Ungrouped</td>\n
<td></td>\n
</tr>\n
\n
<!-- Wait for indexing and go back to this fast input to check everything is OK\n
-->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>selectAndWait</td>\n
<td>select_module</td>\n
<td>Accounts</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>link=Receivable</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//img[@alt=\'Grouping Reference Fast Input\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>off</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>field_your_grouping</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_update_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Updated</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>on</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//span[@id=\'listbox_record_number\']</td>\n
<td>4 record(s)</td>\n
</tr>\n
<tr>\n
<td>assertElementNotPresent</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[6]/a/text()</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertElementNotPresent</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[6]/a/text()</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertElementNotPresent</td>\n
<td>//tr[@id=\'listbox_data_line_2\']/td[6]/a/text()</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertElementNotPresent</td>\n
<td>//tr[@id=\'listbox_data_line_3\']/td[6]/a/text()</td>\n
<td></td>\n
</tr>\n
\n
<!-- }}} -->\n
\n
</tbody></table>\n
</body>\n
</html> <!-- vim: syntax=html foldmethod=marker\n
-->\n
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test_group_from_account_transaction_list.html</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<html>\n
<head><title>Grouping from entity transactions view</title></head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="4">\n
Grouping from entity transaction view\n
</td></tr>\n
</thead><tbody tal:define="init_method string:AccountingZuite_createAccountingTransactionList?add_draft_transactions:int=0&add_related_payments:int=1">\n
\n
<!-- Setup {{{ -->\n
<tal:block metal:use-macro="here/AccountingZuite_CommonTemplate/macros/init"/>\n
<tr>\n
<td>selectAndWait</td>\n
<td>select_module</td>\n
<td>Organisations</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>Folder_show:method</td>\n
<td></td>\n
</tr>\n
<!-- }}} -->\n
\n
<!-- {{{ Select Client 1 Organisation and use grouping fast input -->\n
<tr>\n
<td>clickAndWait</td>\n
<td>link=Client 1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//img[@alt=\'Grouping Reference Fast Input\']</td>\n
<td></td>\n
</tr>\n
\n
<!-- switch on the \'your_grouping\' flag -->\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>off</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>field_your_grouping</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_update_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Updated</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>on</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//fieldset[2]/div/div/span</td>\n
<td>0.00</td>\n
</tr>\n
<tr>\n
<td>verifySelectedLabel</td>\n
<td>field_your_node</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertText</td>\n
<td>//span[@id=\'listbox_record_number\']</td>\n
<td>5 record(s)</td>\n
</tr>\n
<tr>\n
<td>select</td>\n
<td>field_your_node</td>\n
<td>label=41 - Receivable</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_update_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Updated</td>\n
<td></td>\n
</tr>\n
\n
<tr>\n
<td>assertText</td>\n
<td>//span[@id=\'listbox_record_number\']</td>\n
<td>2 record(s)</td>\n
</tr>\n
\n
<!-- select and group -->\n
<tr>\n
<td>click</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[1]/input</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[1]/input</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_submit_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>2 Lines Grouped</td>\n
<td></td>\n
</tr>\n
\n
<!-- mark the module as changed, reindex and come back to the entity -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/AccountingZuite_markChanged</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>selectAndWait</td>\n
<td>select_module</td>\n
<td>Organisations</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>link=Client 1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//img[@alt=\'Grouping Reference Fast Input\']</td>\n
<td></td>\n
</tr>\n
\n
\n
<!-- switch off the \'your_grouping\' flag, to see grouped lines, and ungroup\n
them -->\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>on</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>field_your_grouping</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_update_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Updated</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>off</td>\n
</tr>\n
\n
<tr>\n
<td>verifySelectedLabel</td>\n
<td>field_your_node</td>\n
<td>41 - Receivable</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//span[@id=\'listbox_record_number\']</td>\n
<td>2 record(s)</td>\n
</tr>\n
<tr>\n
<td>assertElementPresent</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[6]/a/text()</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertElementPresent</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[6]/a/text()</td>\n
<td></td>\n
</tr>\n
\n
<!-- now try to ungroup with only one, it should be refused -->\n
<tr>\n
<td>click</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[1]/input</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_submit_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Ungrouping refused. Check your selection</td>\n
<td></td>\n
</tr>\n
\n
<!-- check all and try to ungroup again -->\n
<tr>\n
<td>click</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[1]/input</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_submit_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>2 Lines Ungrouped</td>\n
<td></td>\n
</tr>\n
\n
<!-- Wait for indexing and go back to this fast input to check everything is OK\n
-->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>selectAndWait</td>\n
<td>select_module</td>\n
<td>Organisations</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>link=Client 1</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//img[@alt=\'Grouping Reference Fast Input\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>off</td>\n
</tr>\n
<tr>\n
<td>click</td>\n
<td>field_your_grouping</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//input[@id="dialog_update_button"]</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Updated</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyValue</td>\n
<td>field_your_grouping</td>\n
<td>on</td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>//span[@id=\'listbox_record_number\']</td>\n
<td>2 record(s)</td>\n
</tr>\n
<tr>\n
<td>assertElementNotPresent</td>\n
<td>//tr[@id=\'listbox_data_line_0\']/td[6]/a/text()</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertElementNotPresent</td>\n
<td>//tr[@id=\'listbox_data_line_1\']/td[6]/a/text()</td>\n
<td></td>\n
</tr>\n
<!-- }}} -->\n
\n
</tbody></table>\n
</body>\n
</html> <!-- vim: syntax=html foldmethod=marker\n
-->\n
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test_group_from_entity_transaction_list.html</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -77,8 +77,9 @@ default_date = DateTime(year, 01, 01)\n ...@@ -77,8 +77,9 @@ default_date = DateTime(year, 01, 01)\n
immediate_reindex = 0\n immediate_reindex = 0\n
\n \n
# if the previous test didn\'t change input data, no need to recreate content\n # if the previous test didn\'t change input data, no need to recreate content\n
current_script_data_id = \'%s_month_count_%s_draft_%s_state_%s\' % (\n current_script_data_id = \'%s_month_count_%s_draft_%s_state_%s_payment_%s\' % (\n
month_count, add_draft_transactions, transaction_state, script.getId())\n month_count, add_draft_transactions, transaction_state,\n
add_related_payments, script.getId())\n
\n \n
if accounting_module.getProperty(\'current_content_script\',\n if accounting_module.getProperty(\'current_content_script\',\n
\'\') == current_script_data_id:\n \'\') == current_script_data_id:\n
...@@ -233,6 +234,34 @@ for month in range(1, month_count + 1):\n ...@@ -233,6 +234,34 @@ for month in range(1, month_count + 1):\n
else:\n else:\n
# other cases not supported for now\n # other cases not supported for now\n
assert transaction_state == \'draft\'\n assert transaction_state == \'draft\'\n
if add_related_payments:\n
payment = accounting_module.newContent(\n
causality_value=tr,\n
immediate_reindex=immediate_reindex,\n
portal_type=\'Payment Transaction\',\n
title=\'%s Payment\' % client_title,\n
source_section=section,\n
destination_section=getOrganisationByTitle(client_title),\n
created_by_builder=1,\n
start_date=default_date,\n
stop_date=default_date,\n
resource=euro_resource,\n
)\n
payment.newContent(portal_type=\'Accounting Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Bank\'),\n
quantity=-(amount * (1 + vat_rate)))\n
payment.newContent(portal_type=\'Accounting Transaction Line\',\n
immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Receivable\'),\n
quantity=(amount * (1 + vat_rate)))\n
if transaction_state == \'validated\':\n
payment.stop()\n
assert payment.getSimulationState() == \'stopped\'\n
else:\n
# other cases not supported for now\n
assert transaction_state == \'draft\'\n
\n
amount=7000\n amount=7000\n
default_date += 1\n default_date += 1\n
tr = accounting_module.newContent(\n tr = accounting_module.newContent(\n
...@@ -315,7 +344,7 @@ return "Accounting Transactions Created."\n ...@@ -315,7 +344,7 @@ return "Accounting Transactions Created."\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>month_count=1, add_draft_transactions=1, transaction_state=\'validated\'</string> </value> <value> <string>month_count=1, add_draft_transactions=1, transaction_state=\'validated\', add_related_payments=0</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -335,7 +364,7 @@ return "Accounting Transactions Created."\n ...@@ -335,7 +364,7 @@ return "Accounting Transactions Created."\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>3</int> </value> <value> <int>4</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -344,6 +373,7 @@ return "Accounting Transactions Created."\n ...@@ -344,6 +373,7 @@ return "Accounting Transactions Created."\n
<string>month_count</string> <string>month_count</string>
<string>add_draft_transactions</string> <string>add_draft_transactions</string>
<string>transaction_state</string> <string>transaction_state</string>
<string>add_related_payments</string>
<string>DateTime</string> <string>DateTime</string>
<string>section_title</string> <string>section_title</string>
<string>_getattr_</string> <string>_getattr_</string>
...@@ -383,6 +413,7 @@ return "Accounting Transactions Created."\n ...@@ -383,6 +413,7 @@ return "Accounting Transactions Created."\n
<string>client_title</string> <string>client_title</string>
<string>amount</string> <string>amount</string>
<string>_inplacevar_</string> <string>_inplacevar_</string>
<string>payment</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -398,6 +429,7 @@ return "Accounting Transactions Created."\n ...@@ -398,6 +429,7 @@ return "Accounting Transactions Created."\n
<int>1</int> <int>1</int>
<int>1</int> <int>1</int>
<string>validated</string> <string>validated</string>
<int>0</int>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -107,6 +104,7 @@ for form in context.getPortalObject().portal_skins\\\n ...@@ -107,6 +104,7 @@ for form in context.getPortalObject().portal_skins\\\n
# also reset common selections\n # also reset common selections\n
stool.setSelectionFor(\'person_selection\', None)\n stool.setSelectionFor(\'person_selection\', None)\n
stool.setSelectionFor(\'organisation_selection\', None)\n stool.setSelectionFor(\'organisation_selection\', None)\n
stool.setSelectionFor(\'grouping_reference_fast_input_selection\', None)\n
\n \n
# delete the "dummy account" we create in test_account_gap_parallel_list_field\n # delete the "dummy account" we create in test_account_gap_parallel_list_field\n
dummy_account_list = portal.account_module.searchFolder(\n dummy_account_list = portal.account_module.searchFolder(\n
......
2008-03-03 jerome
* Add tests for grouping reference fast input
2008-01-21 yusei 2008-01-21 yusei
* Add tests for section selection box. * Add tests for section selection box.
......
78 79
\ No newline at end of file \ 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