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

update tests for reversal transaction creation, and add test for multiple...

update tests for reversal transaction creation, and add test for multiple reversal transaction creation from the module

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27753 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5297ecd1
...@@ -205,6 +205,11 @@ delivered.\n ...@@ -205,6 +205,11 @@ delivered.\n
<td>select_action</td>\n <td>select_action</td>\n
<td>Create Reversal Transaction</td>\n <td>Create Reversal Transaction</td>\n
</tr>\n </tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>Base_callDialogMethod:method</td>\n
<td></td>\n
</tr>\n
<tr>\n <tr>\n
<td>assertPortalStatusMessage</td>\n <td>assertPortalStatusMessage</td>\n
<td>Reversal Transaction for * created.</td>\n <td>Reversal Transaction for * created.</td>\n
......
<?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>_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>Test for Creating reversal of multiple transactions</title></head>\n
<body>\n
<table cellpadding="1" cellspacing="1" border="1">\n
<thead>\n
<tr><td rowspan="1" colspan="4">\n
Test for Creating reversal of multiple transactions\n
</td></tr>\n
</thead><tbody tal:define="init_method string:AccountingZuite_createAccountingTransactionList?add_draft_transactions:int=0&amp;transaction_state=delivered">\n
<tal:block metal:use-macro="here/AccountingZuite_CommonTemplate/macros/init"/>\n
\n
<!-- Setup {{{ -->\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}</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>selectAndWait</td>\n
<td>select_module</td>\n
<td>Accounting</td>\n
</tr>\n
<!-- }}} -->\n
\n
<!-- Select All {{{ -->\n
<tr>\n
<td>clickAndWait</td>\n
<td>//button[@title=\'Show All\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>listbox_record_number</td>\n
<td>4 record(s)</td>\n
</tr>\n
<!-- }}} -->\n
\n
<!-- select create reversal action {{{ -->\n
<tr>\n
<td>selectAndWait</td>\n
<td>select_action</td>\n
<td>Create Reversal Transactions</td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>Base_callDialogMethod:method</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertPortalStatusMessage</td>\n
<td>Reversal creation for 4 on 4 transactions in progress.</td>\n
<td></td>\n
</tr>\n
<!-- }}} -->\n
\n
<!-- Check accounting transactions are created {{{ -->\n
<tr>\n
<td>open</td>\n
<td>${base_url}/Zuite_waitForActivities</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>assertTextPresent</td>\n
<td>Done.</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>open</td>\n
<td>${base_url}/accounting_module/view</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>//button[@title=\'Show All\']</td>\n
<td></td>\n
</tr>\n
<tr>\n
<td>verifyText</td>\n
<td>listbox_record_number</td>\n
<td>8 record(s)</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_accounting_transaction_module_create_reversal.html</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -221,6 +221,11 @@ delivered.\n ...@@ -221,6 +221,11 @@ delivered.\n
<td>select_action</td>\n <td>select_action</td>\n
<td>Create Reversal Transaction</td>\n <td>Create Reversal Transaction</td>\n
</tr>\n </tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>Base_callDialogMethod:method</td>\n
<td></td>\n
</tr>\n
<tr>\n <tr>\n
<td>assertPortalStatusMessage</td>\n <td>assertPortalStatusMessage</td>\n
<td>Reversal Transaction for * created.</td>\n <td>Reversal Transaction for * created.</td>\n
......
...@@ -223,6 +223,11 @@ delivered.\n ...@@ -223,6 +223,11 @@ delivered.\n
<td>select_action</td>\n <td>select_action</td>\n
<td>Create Reversal Transaction</td>\n <td>Create Reversal Transaction</td>\n
</tr>\n </tr>\n
<tr>\n
<td>clickAndWait</td>\n
<td>Base_callDialogMethod:method</td>\n
<td></td>\n
</tr> \n
<tr>\n <tr>\n
<td>assertPortalStatusMessage</td>\n <td>assertPortalStatusMessage</td>\n
<td>Reversal Transaction for * created.</td>\n <td>Reversal Transaction for * created.</td>\n
......
...@@ -184,9 +184,14 @@ for month in range(1, month_count + 1):\n ...@@ -184,9 +184,14 @@ for month in range(1, month_count + 1):\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Stocks\'),\n source=getAccountByTitle(\'Stocks\'),\n
quantity=-5000)\n quantity=-5000)\n
# TODO: "validated" should be renamed to "stopped"\n
if transaction_state == \'validated\':\n if transaction_state == \'validated\':\n
tr.stop()\n tr.stop()\n
assert tr.getSimulationState() == \'stopped\'\n assert tr.getSimulationState() == \'stopped\'\n
elif transaction_state == \'delivered\':\n
tr.stop()\n
tr.deliver()\n
assert tr.getSimulationState() == \'delivered\'\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
...@@ -238,6 +243,10 @@ for month in range(1, month_count + 1):\n ...@@ -238,6 +243,10 @@ for month in range(1, month_count + 1):\n
if transaction_state == \'validated\':\n if transaction_state == \'validated\':\n
tr.stop()\n tr.stop()\n
assert tr.getSimulationState() == \'stopped\'\n assert tr.getSimulationState() == \'stopped\'\n
elif transaction_state == \'delivered\':\n
tr.stop()\n
tr.deliver()\n
assert tr.getSimulationState() == \'delivered\'\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
...@@ -262,9 +271,12 @@ for month in range(1, month_count + 1):\n ...@@ -262,9 +271,12 @@ for month in range(1, month_count + 1):\n
immediate_reindex=immediate_reindex,\n immediate_reindex=immediate_reindex,\n
source=getAccountByTitle(\'Receivable\'),\n source=getAccountByTitle(\'Receivable\'),\n
quantity=(amount * (1 + vat_rate)))\n quantity=(amount * (1 + vat_rate)))\n
if transaction_state == \'validated\':\n if transaction_state in (\'validated\', \'delivered\'):\n
payment.stop()\n payment.stop()\n
assert payment.getSimulationState() == \'stopped\'\n assert payment.getSimulationState() == \'stopped\'\n
if transaction_state == \'delivered\':\n
tr.deliver()\n
assert tr.getSimulationState() == \'delivered\'\n
if not keep_grouping_reference:\n if not keep_grouping_reference:\n
for line in payment.getMovementList(\n for line in payment.getMovementList(\n
portal_type=payment.getPortalAccountingMovementTypeList()):\n portal_type=payment.getPortalAccountingMovementTypeList()):\n
...@@ -307,6 +319,10 @@ for month in range(1, month_count + 1):\n ...@@ -307,6 +319,10 @@ for month in range(1, month_count + 1):\n
if transaction_state == \'validated\':\n if transaction_state == \'validated\':\n
tr.stop()\n tr.stop()\n
assert tr.getSimulationState() == \'stopped\'\n assert tr.getSimulationState() == \'stopped\'\n
elif transaction_state == \'delivered\':\n
tr.stop()\n
tr.deliver()\n
assert tr.getSimulationState() == \'delivered\'\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
......
127 128
\ 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