Commit d278d7b7 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: test: bypass Service_getSubscriptionStatus

parent c60ec10b
...@@ -591,6 +591,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin): ...@@ -591,6 +591,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
url_string='type%s' % self.generateNewId(), url_string='type%s' % self.generateNewId(),
) )
@simulate('Service_getSubscriptionStatus', '*args, **kwargs', 'return "subscribed"')
def bootstrapAllocableInstanceTree(self, allocation_state='possible', shared=False, node="compute", def bootstrapAllocableInstanceTree(self, allocation_state='possible', shared=False, node="compute",
is_accountable=False, base_price=None, has_organisation=False): is_accountable=False, base_price=None, has_organisation=False):
if allocation_state not in ('impossible', 'possible', 'allocated'): if allocation_state not in ('impossible', 'possible', 'allocated'):
...@@ -722,6 +723,17 @@ class SlapOSTestCaseMixin(testSlapOSMixin): ...@@ -722,6 +723,17 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
if not ((node == "instance") and (shared)): if not ((node == "instance") and (shared)):
partition.markBusy() 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() self.tic()
return software_product, release_variation, type_variation, compute_node, partition, instance_tree return software_product, release_variation, type_variation, compute_node, partition, instance_tree
......
...@@ -15,6 +15,13 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin): ...@@ -15,6 +15,13 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
compute_node, compute_node,
release_variation.getUrlString() 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() self.tic()
return compute_node, partition 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