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 ...@@ -4,7 +4,10 @@ from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import newSecurityManager 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() portal = self.getPortalObject()
sm = getSecurityManager() sm = getSecurityManager()
...@@ -30,10 +33,19 @@ def ERP5Site_bootstrapSlapOSPanelTest(self): ...@@ -30,10 +33,19 @@ def ERP5Site_bootstrapSlapOSPanelTest(self):
destination_project_value=project, destination_project_value=project,
function='production/manager' function='production/manager'
).open() ).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( manager_person.newContent(
portal_type='ERP5 Login', portal_type='ERP5 Login',
reference='manager#', reference='manager',
password='manager#' password='eiChaxo5Eefier9vAek7phie#'
).validate() ).validate()
manager_person.validate() manager_person.validate()
...@@ -51,8 +63,8 @@ def ERP5Site_bootstrapSlapOSPanelTest(self): ...@@ -51,8 +63,8 @@ def ERP5Site_bootstrapSlapOSPanelTest(self):
).open() ).open()
customer_person.newContent( customer_person.newContent(
portal_type='ERP5 Login', portal_type='ERP5 Login',
reference='customer#', reference='customer',
password='customer#' password='eiChaxo5Eefier9vAek7phie#'
).validate() ).validate()
customer_person.validate() customer_person.validate()
finally: finally:
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>testSlapOSPanel</string> </value> <value> <string>testCustomerInstanceScenario</string> </value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>output_encoding</string> </key>
......
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
</thead> </thead>
<tbody> <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> <tr>
<td>open</td> <td>open</td>
...@@ -25,7 +27,7 @@ ...@@ -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 metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block> </tal:block>
...@@ -211,7 +213,7 @@ ...@@ -211,7 +213,7 @@
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" /> <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 metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block> </tal:block>
...@@ -309,7 +311,7 @@ ...@@ -309,7 +311,7 @@
<tal:block metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/logout" /> <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 metal:use-macro="here/Zuite_SlapOSPanelTemplate/macros/login" />
</tal:block> </tal:block>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<tr> <tr>
<td>open</td> <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> <td></td>
</tr> </tr>
<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