Commit 05c2a4ec authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test: reuse existing script

parent ed4ffd36
......@@ -6,7 +6,6 @@
##############################################################################
from erp5.component.test.testSlapOSERP5VirtualMasterScenario import TestSlapOSVirtualMasterScenarioMixin
from DateTime import DateTime
class TestSlapOSSubscriptionChangeRequestScenarioMixin(TestSlapOSVirtualMasterScenarioMixin):
......@@ -158,41 +157,16 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
open_sale_order_line = open_sale_order_cell.getParentValue()
open_sale_order = open_sale_order_line.getParentValue()
now = DateTime()
subscription_change_request = self.portal.subscription_change_request_module.newContent(
portal_type='Subscription Change Request',
causality_value=open_sale_order,
destination_value=public_person2,
destination_section_value=public_person2,
destination_decision_value=public_person2,
destination_project=open_sale_order.getDestinationProject(),
# XXX XXX should be calculated, and not copied
# to ensure the expected value is fetched
specialise_value=open_sale_order.getSpecialiseValue(),
source=open_sale_order.getSource(),
source_section=open_sale_order.getSourceSection(),
source_project=open_sale_order.getSourceProject(),
price_currency=open_sale_order.getPriceCurrency(),
start_date=now,
effective_date=now,
resource=open_sale_order_line.getResource(),
variation_category_list=open_sale_order_line.getVariationCategoryList(),
quantity_unit=open_sale_order_line.getQuantityUnit(),
aggregate=open_sale_order_cell.getAggregate(portal_type=['Instance Tree', 'Project', 'Compute Node']),
quantity=open_sale_order_cell.getQuantity(),
# ledger="automated",
# XXX check that price is consistent with trade condition payable or not
price=open_sale_order_cell.getPrice() + 1,
# XXX activate_kw=activate_kw
subscription_change_request = open_sale_order_cell.getResourceValue().Resource_createSubscriptionRequest(
public_person2,
# [software_type, software_release],
open_sale_order_cell.getVariationCategoryList(),
open_sale_order.getSourceProjectValue(),
currency_value=open_sale_order.getPriceCurrencyValue(),
portal_type='Subscription Change Request'
)
subscription_change_request.submit()
subscription_change_request.setAggregateValue(instance_tree)
subscription_change_request.setCausalityValue(open_sale_order)
self.tic()
self.logout()
......
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