Commit fda3ba4c authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5:

* check kthat correct release/type have been selected
* get price from sale supply
parent 64977f1a
...@@ -174,6 +174,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin): ...@@ -174,6 +174,7 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
) )
public_server_software = self.generateNewSoftwareReleaseUrl() public_server_software = self.generateNewSoftwareReleaseUrl()
public_instance_type = 'public type'
# XXX who create the product # XXX who create the product
# define the security # define the security
...@@ -218,21 +219,45 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin): ...@@ -218,21 +219,45 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
) )
software_product.newContent( software_product.newContent(
portal_type="Software Product Release Variation", portal_type="Software Product Release Variation",
title="my super release", title="my old release",
url_string=public_server_software + '-1'
)
release_variation = software_product.newContent(
portal_type="Software Product Release Variation",
title="my current release",
url_string=public_server_software url_string=public_server_software
) )
software_product.newContent(
portal_type="Software Product Release Variation",
title="my futur release",
url_string=public_server_software + '+1'
)
software_product.newContent( software_product.newContent(
portal_type="Software Product Type Variation", portal_type="Software Product Type Variation",
title="my super type" title=public_instance_type + '-1'
)
type_variation = software_product.newContent(
portal_type="Software Product Type Variation",
title=public_instance_type
)
software_product.newContent(
portal_type="Software Product Type Variation",
title=public_instance_type + '+1'
) )
software_product.validate() software_product.validate()
sale_supply = self.portal.sale_supply_module.newContent(
portal_type="Sale Supply",
destination_project_value=project,
price_currency="currency_module/EUR"
)
# XXX Put price in sale supply module # XXX Put price in sale supply module
sale_trade_condition.newContent( sale_supply.newContent(
portal_type="Sale Supply Line", portal_type="Sale Supply Line",
base_price=9, base_price=9,
resource_value=software_product resource_value=software_product
) )
sale_supply.validate()
# some preparation # some preparation
self.logout() self.logout()
...@@ -280,7 +305,6 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin): ...@@ -280,7 +305,6 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
reference=public_reference).getParentValue() reference=public_reference).getParentValue()
public_instance_title = 'Public title %s' % self.generateNewId() public_instance_title = 'Public title %s' % self.generateNewId()
public_instance_type = 'public type'
self.checkInstanceAllocation(public_person.getUserId(), self.checkInstanceAllocation(public_person.getUserId(),
public_reference, public_instance_title, public_reference, public_instance_title,
public_server_software, public_instance_type, public_server_software, public_instance_type,
...@@ -336,10 +360,12 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin): ...@@ -336,10 +360,12 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
}) })
assert len(inventory_list) == 1, len(inventory_list) assert len(inventory_list) == 1, len(inventory_list)
assert inventory_list[0].quantity == 1, inventory_list[0].quantity assert inventory_list[0].quantity == 1, inventory_list[0].quantity
resource_vcl = list(software_product.getVariationCategoryList( resource_vcl = [
omit_individual_variation=0)) 'software_release/%s' % release_variation.getRelativeUrl(),
'software_type/%s' % type_variation.getRelativeUrl()
]
resource_vcl.sort() resource_vcl.sort()
assert inventory_list[0].getVariationCategoryList() == resource_vcl, inventory_list[0].getVariationCategoryList() assert inventory_list[0].getVariationCategoryList() == resource_vcl, "%s %s" % (resource_vcl, inventory_list[0].getVariationCategoryList())
# Check accounting # Check accounting
transaction_list = self.portal.account_module.receivable.Account_getAccountingTransactionList(mirror_section_uid=public_person.getUid()) transaction_list = self.portal.account_module.receivable.Account_getAccountingTransactionList(mirror_section_uid=public_person.getUid())
...@@ -359,11 +385,12 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin): ...@@ -359,11 +385,12 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin):
# 7 simulation mvt # 7 simulation mvt
# 1 software product # 1 software product
# 1 sale trace condition, 1 supply line # 1 sale trace condition
# 1 supply, 1 supply line
# 1 open order line / 1 cell # 1 open order line / 1 cell
related_object_list = project.Base_getRelatedObjectList(**{'category.category_strict_membership': 1}) related_object_list = project.Base_getRelatedObjectList(**{'category.category_strict_membership': 1})
assert len(related_object_list) == 25, [x.getRelativeUrl() for x in related_object_list] assert len(related_object_list) == 26, [x.getRelativeUrl() for x in related_object_list]
self.stepcheckERP5Consistency() self.stepcheckERP5Consistency()
......
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