Commit 4b3a9cd6 authored by Rafael Monnerat's avatar Rafael Monnerat

Include scripts and code for Sale Order Tutorial Test Split

The former test for Sale Order cover 4 different tutorials, the changes
aims to support this split, by introducing extra "setUp" scripts for the
additional tests.

Additional tearDown are not needed because Zuite_tearDownSaleOrderTest is enough to cover all 4 tests.
parent c4626b7c
......@@ -105,10 +105,6 @@
<none/>
</value>
</item>
<item>
<key> <string>last_id</string> </key>
<value> <string>4</string> </value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
......
......@@ -108,10 +108,6 @@
<none/>
</value>
</item>
<item>
<key> <string>last_id</string> </key>
<value> <string>3</string> </value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
......
......@@ -116,10 +116,6 @@
<none/>
</value>
</item>
<item>
<key> <string>last_id</string> </key>
<value> <string>4</string> </value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
howto_dict = context.Zuite_getHowToInfo()\n
\n
# check if there is already the euro curency on the instance\n
\n
invoice = context.portal_catalog.getResultValue(\n
portal_type=\'Sale Invoice Transaction\',\n
title=\'ZUITE-TEST-SALEORDER-PRODUCT-001\',)\n
if portal.portal_workflow.isTransitionPossible(invoice, "start"):\n
invoice.start()\n
if not start_only:\n
invoice.stop()\n
invoice.deliver()\n
# Clear cache\n
portal.portal_caches.clearAllCache()\n
\n
return "Init Ok"\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>clean=True,start_only=False</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_setUpPaymentTest</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
howto_dict = context.Zuite_getHowToInfo()\n
\n
# check if there is already the euro curency on the instance\n
\n
sale_packing_list = context.portal_catalog.getResultValue(\n
portal_type=\'Sale Packing List\',\n
title=\'ZUITE-TEST-SALEORDER-PRODUCT-001\',)\n
sale_packing_list.start()\n
sale_packing_list.deliver()\n
# Clear cache\n
portal.portal_caches.clearAllCache()\n
\n
return "Init Ok"\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>clean=True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_setUpSaleInvoiceTest</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -73,7 +73,6 @@ if context.portal_templates.getInstalledBusinessTemplate("erp5_simulation_test")
business_process.account_credit_path.setSourceValue(context.account_module.receivable)\n
if isTransitionPossible(business_process, \'validate\'):\n
business_process.validate()\n
# check if there is already the euro curency on the instance\n
currency = context.portal_catalog.getResultValue(portal_type=\'Currency\',\n
title=howto_dict[\'sale_howto_currency_title\'])\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_body</string> </key>
<value> <string>\n
portal = context.getPortalObject()\n
howto_dict = context.Zuite_getHowToInfo()\n
\n
# check if there is already the euro curency on the instance\n
currency = context.portal_catalog.getResultValue(portal_type=\'Currency\',\n
title=howto_dict[\'sale_howto_currency_title\'])\n
\n
# add default sale order trade condition\n
sale_order_trade_condition = context.portal_catalog.getResultValue(portal_type=\'Sale Trade Condition\',\n
reference=\'STC-General\')\n
\n
# Get the documents created by setUpSaleOrder\n
product = context.portal_catalog.getResultValue(portal_type=\'Product\',\n
title=howto_dict[\'sale_howto_product_title\'])\n
\n
my_organisation = context.portal_catalog.getResultValue(portal_type=\'Organisation\',\n
title=howto_dict[\'sale_howto_organisation_title\'],\n
corporate_name=howto_dict[\'sale_howto_organisation_title\'])\n
\n
organisation = context.portal_catalog.getResultValue(portal_type=\'Organisation\',\n
title=howto_dict[\'sale_howto_organisation2_title\'],\n
corporate_name=howto_dict[\'sale_howto_organisation2_title\'])\n
\n
person = context.portal_catalog.getResultValue(portal_type=\'Person\',\n
title=howto_dict[\'sale_howto_person_title\'],\n
career_subordination_title=howto_dict[\'sale_howto_organisation_title\'])\n
\n
\n
sale_order = portal.sale_order_module.newContent(\n
portal_type=\'Sale Order\', title=\'ZUITE-TEST-SALEORDER-PRODUCT-001\', specialise=sale_order_trade_condition.getRelativeUrl(),\n
destination_section=organisation.getRelativeUrl(),\n
destination=organisation.getRelativeUrl(),\n
source_section=my_organisation.getRelativeUrl(),\n
source=my_organisation.getRelativeUrl(),\n
source_decision=my_organisation.getRelativeUrl(),\n
destination_decision=organisation.getRelativeUrl(),\n
destination_administration=person.getRelativeUrl(),\n
source_administration=my_organisation.getRelativeUrl(),\n
delivery_mode=\'delivery_mode/air\',\n
order=\'order/normal\',\n
start_date=DateTime(),\n
stop_date=DateTime()+1,\n
)\n
sale_order.setPriceCurrency(currency.getRelativeUrl())\n
sale_order.setIncoterm(\'incoterm/cpt\')\n
\n
sale_order.newContent(portal_type=\'Sale Order Line\',\n
resource=product.getRelativeUrl(), price=1.0, quantity=100000.0)\n
sale_order.confirm()\n
# Clear cache\n
portal.portal_caches.clearAllCache()\n
\n
return "Init Ok"\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>clean=True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_setUpSalePackingListTest</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -119,7 +119,7 @@
</tal:block>\n
\n
<tal:block metal:define-macro="invoke_simulation_alarms">\n
<!-- Wait for activities to finish -->\n
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"> Wait for activities </span>\\ <!-- Wait for activities to finish -->\n
<tr>\n
<td>openAndWait</td>\n
<td>${base_url}/Zuite_invokeSimulationAlarmList</td>\n
......@@ -130,6 +130,7 @@
<td>Done.</td>\n
<td></td>\n
</tr> \n
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/wait_for_activities"> Wait for activities </span>\n
</tal:block>\n
\n
<tal:block metal:define-macro="login_as_functional_test_user">\n
......
erp5_base
erp5_base
\ No newline at end of file
785
\ No newline at end of file
786
\ No newline at end of file
base_amount
delivery_mode
incoterm
incoterm
\ No newline at end of file
......@@ -5,8 +5,8 @@ portal_categories/function/marketing
portal_categories/function/marketing/marketing_manager
portal_categories/function/sales
portal_categories/function/sales/manager
portal_categories/gender/male
portal_categories/gender/female
portal_categories/gender/male
portal_categories/group/my_group
portal_categories/incoterm/cpt
portal_categories/nationality/french
......@@ -18,6 +18,4 @@ portal_categories/quantity_unit/unit
portal_categories/quantity_unit/unit/**
portal_categories/region/brazil
portal_categories/role/**
portal_categories/use/test_functional_incoming_service
sale_trade_condition_module/1
sale_trade_condition_module/1/**
portal_categories/use/test_functional_incoming_service
\ 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