Commit bcb89bd6 authored by Romain Courteaud's avatar Romain Courteaud

slapos_slap_tool: Release

parent de437360
......@@ -2299,27 +2299,19 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
new_id = self.generateNewId()
software_product = self._makeSoftwareProduct(self.project, new_id=new_id)
# 2 published software releases
software_release1 = self._makeSoftwareRelease(software_product)
software_release2 = self._makeSoftwareRelease(software_product)
software_release1 = self._makeSoftwareRelease(software_product, url='http://example.org/1.cfg')
software_release2 = self._makeSoftwareRelease(software_product, url='http://example.org/2.cfg')
software_release1.publish()
software_release2.publish()
# 1 released software release, should not appear
software_release3 = self._makeSoftwareRelease(software_product)
software_release3 = self._makeSoftwareRelease(software_product, url='http://example.org/3.cfg')
self.assertTrue(software_release3.getValidationState() == 'released')
software_release1.edit(
aggregate_value=software_product.getRelativeUrl(),
url_string='http://example.org/1.cfg',
effective_date=DateTime()
)
software_release2.edit(
aggregate_value=software_product.getRelativeUrl(),
url_string='http://example.org/2.cfg',
effective_date=DateTime()
)
software_release3.edit(
aggregate_value=software_product.getRelativeUrl(),
url_string='http://example.org/3.cfg'
)
self.tic()
response = self.portal_slap.getSoftwareReleaseListFromSoftwareProduct(
......@@ -2342,26 +2334,17 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
new_id = self.generateNewId()
software_product = self._makeSoftwareProduct(self.project, new_id=new_id)
# 3 published software releases
software_release1 = self._makeSoftwareRelease(software_product)
software_release2 = self._makeSoftwareRelease(software_product)
software_release3 = self._makeSoftwareRelease(software_product)
software_release1.publish()
software_release2.publish()
software_release3.publish()
software_release1 = self._makeSoftwareRelease(software_product, url='http://example.org/1.cfg')
software_release2 = self._makeSoftwareRelease(software_product, url='http://example.org/2.cfg')
software_release3 = self._makeSoftwareRelease(software_product, url='http://example.org/3.cfg')
software_release1.edit(
aggregate_value=software_product.getRelativeUrl(),
url_string='http://example.org/1.cfg',
effective_date=(DateTime() - 1)
)
# Should not be considered yet!
software_release2.edit(
aggregate_value=software_product.getRelativeUrl(),
url_string='http://example.org/2.cfg',
effective_date=(DateTime() + 1)
)
software_release3.edit(
aggregate_value=software_product.getRelativeUrl(),
url_string='http://example.org/3.cfg',
effective_date=DateTime()
)
self.tic()
......@@ -2422,8 +2405,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
# 2 published software releases
software_release1 = self._makeSoftwareRelease(software_product)
software_release2 = self._makeSoftwareRelease(software_product)
software_release1.publish()
software_release2.publish()
# 1 released software release, should not appear
software_release3 = self._makeSoftwareRelease(software_product)
self.assertTrue(software_release3.getValidationState() == 'released')
......
......@@ -386,7 +386,7 @@ class SlapTool(BaseTool):
if software_product_reference is None:
assert(software_release_url is not None)
software_product_reference = self.getPortalObject().portal_catalog.unrestrictedSearchResults(
portal_type='Software Release',
portal_type='Software Product Release Variation',
url_string=software_release_url
)[0].getObject().getAggregateValue().getReference()
else:
......@@ -402,7 +402,7 @@ class SlapTool(BaseTool):
if len(software_product_list) > 1:
raise NotImplementedError('Several Software Product with the same title.')
software_release_list = \
software_product_list[0].getObject().getAggregateRelatedValueList()
software_product_list[0].getObject().contentValues(portal_type='Software Product Release Variation')
def sortkey(software_release):
publication_date = software_release.getEffectiveDate()
......
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