Commit 4466c3f6 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: move test function to mixin

parent 0aabed32
......@@ -52,6 +52,48 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
# Create akarls steps
self.createAlarmStep()
def createProject(self):
project = self.portal.project_module.newContent(
portal_type='Project',
title='project-%s' % self.generateNewId()
)
project.validate()
return project
def createAdminUser(self, project):
""" Create a Admin user, to manage compute_nodes and instances eventually """
admin_user_login = self.portal.portal_catalog.getResultValue(
portal_type="ERP5 Login",
reference="admin_user",
validation_state="validated"
)
if admin_user_login is None:
admin_user = self.portal.person_module.template_member.\
Base_createCloneDocument(batch_mode=1)
admin_user.newContent(
portal_type="ERP5 Login",
reference="admin_user").validate()
admin_user.edit(
first_name="Admin User",
reference="Admin_user",
default_email_text="do_not_reply_to_admin@example.org",
)
admin_user.validate()
else:
admin_user = admin_user_login.getParentValue()
admin_user.newContent(
portal_type='Assignment',
destination_project_value=project,
function='computer/manager'
).open()
self.admin_user = admin_user
@changeSkin('Hal')
def joinSlapOS(self, web_site, reference):
def findMessage(email, body):
......
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