Commit 7c7c354d authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: check kthat correct release/type have been selected

parent ac7c11e4
...@@ -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,12 +219,30 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin): ...@@ -218,12 +219,30 @@ 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()
...@@ -280,7 +299,6 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin): ...@@ -280,7 +299,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 +354,12 @@ class TestSlapOSVirtualMasterScenario(DefaultScenarioMixin): ...@@ -336,10 +354,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())
......
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