Commit 1e803f8a authored by Romain Courteaud's avatar Romain Courteaud

slapos_panel_ui_test: HARDCODED data/user bootstrap

parent 86ce8285
from Products.ERP5Security import SUPER_USER
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import newSecurityManager
def ERP5Site_bootstrapSlapOSPanelTest(self):
portal = self.getPortalObject()
sm = getSecurityManager()
try:
newSecurityManager(None, portal.acl_users.getUser(SUPER_USER))
# Create Project
project = portal.project_module.newContent(
portal_type="Project",
title='Test Project'
)
project.validate()
# Bootstrap one manager user
manager_person = portal.person_module.newContent(
portal_type='Person',
first_name='Manual test Project Manager',
default_email_coordinate_text='romain+manager@nexedi.com'
)
manager_person.newContent(
portal_type='Assignment',
title='Production Manager for project %s' % project.getTitle(),
destination_project_value=project,
function='production/manager'
).open()
manager_person.newContent(
portal_type='ERP5 Login',
reference='manager#',
password='manager#'
).validate()
manager_person.validate()
# Bootstrap one customer user
customer_person = portal.person_module.newContent(
portal_type='Person',
first_name='Manual test Project Customer',
default_email_coordinate_text='romain+customer@nexedi.com'
)
customer_person.newContent(
portal_type='Assignment',
title='Customer for project %s' % project.getTitle(),
destination_project_value=project,
function='customer'
).open()
customer_person.newContent(
portal_type='ERP5 Login',
reference='customer#',
password='customer#'
).validate()
customer_person.validate()
finally:
setSecurityManager(sm)
return "Done."
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Extension Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>SlapOSPanelUiTest</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>extension.erp5.SlapOSPanelUiTest</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Extension Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>ERP5Site_bootstrapSlapOSPanelTest</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>SlapOSPanelUiTest</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_bootstrapSlapOSPanelTest</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
extension.erp5.SlapOSPanelUiTest
\ 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