Commit 7749a294 authored by Romain Courteaud's avatar Romain Courteaud

slapos_subscription_request: create software product/release in test

parent b7ae6903
......@@ -262,6 +262,25 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
return subscription_condition
def createSubscriptionCondition(self, slave=False):
url_string = self.generateNewSoftwareReleaseUrl()
# Create Software Product/Release
software_product = self.portal.software_product_module.newContent(
portal_type="Software Product",
title="TestSoftwareProduct",
follow_value=self.subscription_project
)
software_product.validate()
software_release = self.portal.software_release_module.newContent(
portal_type="Software Release",
title="TestSoftwareRelease",
url_string=url_string,
aggregate_value=software_product,
follow_value=self.subscription_project
)
software_release.share()
sale_trade_condition = self.portal.sale_trade_condition_module.newContent(
portal_type="Sale Trade Condition",
title="TestSubscriptionScenario",
......@@ -277,7 +296,7 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
sale_trade_condition.newContent(
portal_type="Sale Supply Line",
base_price=self.expected_individual_price_without_tax,
resource='service_module/slapos_instance_subscription',
resource_value=software_product,
)
sale_trade_condition.newContent(
portal_type="Sale Supply Line",
......@@ -290,7 +309,7 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
title="TestSubscriptionScenario",
short_tile="Test Your Scenario",
description="This is a test",
url_string=self.generateNewSoftwareReleaseUrl(),
url_string=url_string,
root_slave=slave,
default_source_reference="default",
reference="rapidvm%s" % self.new_id,
......
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