Commit b54e9928 authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel_ui_test: test remote node allocation

parent 77285a24
......@@ -21,9 +21,11 @@ def ERP5Site_activateAlarmSlapOSPanelTest(self):
def ERP5Site_bootstrapSlapOSPanelTest(self, scenario, customer_login,
manager_login, passwd):
manager_login, remote_customer_login,
passwd):
if scenario not in ['accounting', 'customer', 'customer_shared']:
if scenario not in ['accounting', 'customer', 'customer_shared',
'customer_remote']:
raise ValueError('Unsupported bootstrap scenario: %s' % scenario)
portal = self.getPortalObject()
......@@ -47,6 +49,13 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, scenario, customer_login,
)
project.validate()
if scenario == 'customer_remote':
remote_project = portal.project_module.newContent(
portal_type="Project",
title='Test Remote Project'
)
remote_project.validate()
# Bootstrap one manager user
manager_person = portal.person_module.newContent(
portal_type='Person',
......@@ -93,6 +102,34 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, scenario, customer_login,
password=passwd
).validate()
customer_person.validate()
if scenario == 'customer_remote':
customer_person.newContent(
portal_type='Assignment',
title='Production Manager for project %s' % remote_project.getTitle(),
destination_project_value=remote_project,
function='production/manager'
).open()
# Bootstrap one customer user for the remote project
remote_customer_person = portal.person_module.newContent(
portal_type='Person',
first_name='Manual test Remote Project Customer',
default_email_coordinate_text='romain+remote+customer@nexedi.com'
)
remote_customer_person.newContent(
portal_type='Assignment',
title='Customer for project %s' % remote_project.getTitle(),
destination_project_value=remote_project,
function='customer'
).open()
remote_customer_person.newContent(
portal_type='ERP5 Login',
reference=remote_customer_login,
password=passwd
).validate()
remote_customer_person.validate()
finally:
setSecurityManager(sm)
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</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>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>testCustomerRemoteInstanceScenario</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -4,6 +4,7 @@ now = int(DateTime())
return {
'customer_login': 'testcustomer%s' % now,
'remote_customer_login': 'testremotecustomer%s' % now,
'manager_login': 'testmanager%s' % now,
'passwd': 'eiChaxo5Eefier9vAek7phie$%s' % now
}
......@@ -11,7 +11,7 @@
<tr>
<td>open</td>
<td tal:content="python: '${base_url}/ERP5Site_bootstrapSlapOSPanelTest?scenario=%s&manager_login=%s&customer_login=%s&passwd=%s' % (init_configuration['scenario'], user_configuration['manager_login'], user_configuration['customer_login'], user_configuration['passwd'])">.../ERP5Site_bootstrapSlapOSPanelTest</td>
<td tal:content="python: '${base_url}/ERP5Site_bootstrapSlapOSPanelTest?scenario=%s&manager_login=%s&customer_login=%s&remote_customer_login=%s&passwd=%s' % (init_configuration['scenario'], user_configuration['manager_login'], user_configuration['customer_login'], user_configuration['remote_customer_login'], user_configuration['passwd'])">.../ERP5Site_bootstrapSlapOSPanelTest</td>
<td></td>
</tr>
<tr>
......
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