Commit 9995b36b authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: test: create a organisation linked to the person if needed

parent 733591c7
......@@ -613,11 +613,18 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
)
def bootstrapAllocableInstanceTree(self, allocation_state='possible', shared=False, node="compute",
is_accountable=False, base_price=None):
is_accountable=False, base_price=None, has_organisation=False):
if allocation_state not in ('impossible', 'possible', 'allocated'):
raise ValueError('Not supported allocation_state: %s' % allocation_state)
project = self.addProject(is_accountable=is_accountable)
person = self.makePerson(project)
if has_organisation:
organisation = self.portal.organisation_module.newContent(
portal_type="Organisation",
title="customer-seller-%s" % self.generateNewId()
)
organisation.validate()
person.edit(career_subordination_value=organisation)
software_product = self._makeSoftwareProduct(project)
release_variation = software_product.contentValues(portal_type='Software Product Release Variation')[0]
type_variation = software_product.contentValues(portal_type='Software Product Type Variation')[0]
......
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