Commit 0639d286 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: test: bypass Service_getSubscriptionStatus

parent f1133868
......@@ -591,6 +591,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
url_string='type%s' % self.generateNewId(),
)
@simulate('Service_getSubscriptionStatus', '*args, **kwargs', 'return "subscribed"')
def bootstrapAllocableInstanceTree(self, allocation_state='possible', shared=False, node="compute",
is_accountable=False, base_price=None, has_organisation=False):
if allocation_state not in ('impossible', 'possible', 'allocated'):
......@@ -722,6 +723,17 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
if not ((node == "instance") and (shared)):
partition.markBusy()
# create fake open order, to bypass Service_getSubscriptionStatus
for item in [instance_tree.getSuccessorValue(), partition.getParentValue()]:
open_order = self.portal.open_sale_order_module.newContent(
portal_type="Open Sale Order",
ledger="automated",
destination_section_value=person
)
open_order.newContent(
aggregate_value=item
)
self.portal.portal_workflow._jumpToStateFor(open_order, 'validated')
self.tic()
return software_product, release_variation, type_variation, compute_node, partition, instance_tree
......
......@@ -15,6 +15,13 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
compute_node,
release_variation.getUrlString()
)
open_order = self.portal.open_sale_order_module.newContent(
portal_type="Open Sale Order",
)
open_order.newContent(
aggregate_value=compute_node
)
self.portal.portal_workflow._jumpToStateFor(open_order, 'validated')
self.tic()
return compute_node, partition
......
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