Commit e2d5020e authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel_ui_test: passwd policy

parent 1e803f8a
......@@ -4,7 +4,10 @@ from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
def ERP5Site_bootstrapSlapOSPanelTest(self):
def ERP5Site_bootstrapSlapOSPanelTest(self, scenario):
if scenario not in ['customer', 'customer_shared']:
raise ValueError('Unsupported bootstrap scenario: %s' % scenario)
portal = self.getPortalObject()
sm = getSecurityManager()
......@@ -30,10 +33,19 @@ def ERP5Site_bootstrapSlapOSPanelTest(self):
destination_project_value=project,
function='production/manager'
).open()
if scenario == 'customer_shared':
# XXX For shared instance, user must also be a customer
# How to create Instance Node without any user related document?
manager_person.newContent(
portal_type='Assignment',
title='Customer for project %s' % project.getTitle(),
destination_project_value=project,
function='customer'
).open()
manager_person.newContent(
portal_type='ERP5 Login',
reference='manager#',
password='manager#'
reference='manager',
password='eiChaxo5Eefier9vAek7phie#'
).validate()
manager_person.validate()
......@@ -51,8 +63,8 @@ def ERP5Site_bootstrapSlapOSPanelTest(self):
).open()
customer_person.newContent(
portal_type='ERP5 Login',
reference='customer#',
password='customer#'
reference='customer',
password='eiChaxo5Eefier9vAek7phie#'
).validate()
customer_person.validate()
finally:
......
......@@ -42,7 +42,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testSlapOSPanel</string> </value>
<value> <string>testCustomerInstanceScenario</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
......
......@@ -14,7 +14,9 @@
</thead>
<tbody>
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/slapos_init" />
<tal:block tal:define="init_configuration python: {'scenario': 'customer'}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/slapos_init" />
</tal:block>
<tr>
<td>open</td>
......@@ -25,7 +27,7 @@
<tal:block tal:define="login_configuration python: {'user': 'manager#', 'password': 'manager#'}">
<tal:block tal:define="login_configuration python: {'user': 'manager', 'password': 'eiChaxo5Eefier9vAek7phie#'}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
......@@ -211,7 +213,7 @@
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" />
<tal:block tal:define="login_configuration python: {'user': 'customer#', 'password': 'customer#'}">
<tal:block tal:define="login_configuration python: {'user': 'customer', 'password': 'eiChaxo5Eefier9vAek7phie#'}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
......@@ -309,7 +311,7 @@
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" />
<tal:block tal:define="login_configuration python: {'user': 'manager#', 'password': 'manager#'}">
<tal:block tal:define="login_configuration python: {'user': 'manager', 'password': 'eiChaxo5Eefier9vAek7phie#'}">
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block>
......
......@@ -11,7 +11,7 @@
<tr>
<td>open</td>
<td tal:content="python:'${base_url}/ERP5Site_bootstrapSlapOSPanelTest'">.../ERP5Site_bootstrapSlapOSPanelTest</td>
<td tal:content="python: '${base_url}/ERP5Site_bootstrapSlapOSPanelTest?scenario=%s' % init_configuration['scenario']">.../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