Commit c83ec8f6 authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel_ui_test: randomize logins

parent 9fd65714
......@@ -4,7 +4,8 @@ from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
def ERP5Site_bootstrapSlapOSPanelTest(self, scenario):
def ERP5Site_bootstrapSlapOSPanelTest(self, scenario, customer_login,
manager_login, passwd):
if scenario not in ['accounting', 'customer', 'customer_shared']:
raise ValueError('Unsupported bootstrap scenario: %s' % scenario)
......@@ -53,8 +54,8 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, scenario):
).open()
manager_person.newContent(
portal_type='ERP5 Login',
reference='manager',
password='eiChaxo5Eefier9vAek7phie#'
reference=manager_login,
password=passwd
).validate()
manager_person.validate()
......@@ -72,8 +73,8 @@ def ERP5Site_bootstrapSlapOSPanelTest(self, scenario):
).open()
customer_person.newContent(
portal_type='ERP5 Login',
reference='customer',
password='eiChaxo5Eefier9vAek7phie#'
reference=customer_login,
password=passwd
).validate()
customer_person.validate()
finally:
......
......@@ -12,7 +12,7 @@
<td rowspan="1" colspan="3">Test SlapOS Panel</td>
</tr>
</thead>
<tbody>
<tbody tal:define="user_configuration python: context.ERP5Site_generateTestUserConfiguration()">
<tal:block tal:define="init_configuration python: {'scenario': 'accounting'}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/slapos_init" />
......@@ -27,7 +27,7 @@
<tal:block tal:define="login_configuration python: {'user': 'manager', 'password': 'eiChaxo5Eefier9vAek7phie#'}">
<tal:block tal:define="login_configuration python: {'user': user_configuration['manager_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
......@@ -284,7 +284,7 @@
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" />
<tal:block tal:define="login_configuration python: {'user': 'customer', 'password': 'eiChaxo5Eefier9vAek7phie#'}">
<tal:block tal:define="login_configuration python: {'user': user_configuration['customer_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
......
......@@ -12,7 +12,7 @@
<td rowspan="1" colspan="3">Test SlapOS Panel</td>
</tr>
</thead>
<tbody>
<tbody tal:define="user_configuration python: context.ERP5Site_generateTestUserConfiguration()">
<tal:block tal:define="init_configuration python: {'scenario': 'customer'}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/slapos_init" />
......@@ -27,7 +27,7 @@
<tal:block tal:define="login_configuration python: {'user': 'manager', 'password': 'eiChaxo5Eefier9vAek7phie#'}">
<tal:block tal:define="login_configuration python: {'user': user_configuration['manager_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
......@@ -218,7 +218,7 @@
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" />
<tal:block tal:define="login_configuration python: {'user': 'customer', 'password': 'eiChaxo5Eefier9vAek7phie#'}">
<tal:block tal:define="login_configuration python: {'user': user_configuration['customer_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
......@@ -316,7 +316,7 @@
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" />
<tal:block tal:define="login_configuration python: {'user': 'manager', 'password': 'eiChaxo5Eefier9vAek7phie#'}">
<tal:block tal:define="login_configuration python: {'user': user_configuration['manager_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
......
......@@ -12,7 +12,7 @@
<td rowspan="1" colspan="3">Test SlapOS Panel</td>
</tr>
</thead>
<tbody>
<tbody tal:define="user_configuration python: context.ERP5Site_generateTestUserConfiguration()">
<tal:block tal:define="init_configuration python: {'scenario': 'customer_shared'}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/slapos_init" />
......@@ -27,7 +27,7 @@
<tal:block tal:define="login_configuration python: {'user': 'manager', 'password': 'eiChaxo5Eefier9vAek7phie#'}">
<tal:block tal:define="login_configuration python: {'user': user_configuration['manager_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
......@@ -358,7 +358,7 @@
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" />
<tal:block tal:define="login_configuration python: {'user': 'customer', 'password': 'eiChaxo5Eefier9vAek7phie#'}">
<tal:block tal:define="login_configuration python: {'user': user_configuration['customer_login'], 'password': user_configuration['passwd']}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
......
from DateTime import DateTime
now = int(DateTime())
return {
'customer_login': 'testcustomer%s' % now,
'manager_login': 'testmanager%s' % now,
'passwd': 'eiChaxo5Eefier9vAek7phie$%s' % now
}
<?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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_generateTestUserConfiguration</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -11,7 +11,7 @@
<tr>
<td>open</td>
<td tal:content="python: '${base_url}/ERP5Site_bootstrapSlapOSPanelTest?scenario=%s' % init_configuration['scenario']">.../ERP5Site_bootstrapSlapOSPanelTest</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></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