Commit b231f5ef authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Add method to clean up requests

   Sequential requests after tic would leave values on behind, so this helps to keep request clean after tic() been called. Or transaction been commited.
parent 4893e1e5
......@@ -142,10 +142,9 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
_custom_additional_bt5_list = []
# Used by testSlapOSERP5GroupRoleSecurity.TestSlapOSGroupRoleSecurityCoverage for
# searh classes for assert overage
# search classes for assert overage
security_group_role_test_id_list = ['test.erp5.testSlapOSERP5GroupRoleSecurity']
def afterSetUp(self):
testSlapOSMixin.afterSetUp(self)
self.changeSkin('View')
......@@ -156,6 +155,14 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
"""Overwrite this function on project context to tweak production focus tests"""
pass
def cleanUpRequest(self):
""" set None some values that can cause problems in tests
"""
for key in self.portal.REQUEST.keys():
if key.endswith("_inProgress"):
# Reset values set on script_ComputeNode_requestSoftwareReleaseChange
self.portal.REQUEST.set(key, None)
def addAccountingManagerAssignment(self, person):
person.newContent(
portal_type='Assignment',
......@@ -290,7 +297,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
project_reference=project.getReference()
)
# As the software url does not match any service, and any trade condition
# As the software url does not match any service, and any trade condition
# no instance is automatically created.
# except if we fake Item_getSubscriptionStatus
with TemporaryAlarmScript(self.portal, 'Item_getSubscriptionStatus', "'subscribed'"):
......@@ -352,7 +359,6 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
self.portal.portal_workflow._jumpToStateFor(self.software_instance, 'start_requested')
self.software_instance.validate()
self.requested_software_instance.edit(
title=self.generateNewSoftwareTitle(),
reference="TESTSI-%s" % self.generateNewId(),
......
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