Commit a4b00c88 authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Rafael Monnerat

add unit test for ERP5Site_isSupportRequestCreationClosed with suspended state

parent db8abee2
......@@ -44,12 +44,7 @@ class TestSlapOSCloudSupportRequestGeneration(testSlapOSMixin):
for support_request in self.portal.portal_catalog(
portal_type="Support Request",
title="Test Support Request %",
simulation_state="validated"):
support_request.invalidate()
for support_request in self.portal.portal_catalog(
portal_type="Support Request",
title="Allocation scope has been changed for TESTCOMPT%",
simulation_state="suspended"):
simulation_state=["validated", "suspended"]):
support_request.invalidate()
self.tic()
......@@ -235,6 +230,29 @@ class TestSlapOSCloudSupportRequestGeneration(testSlapOSMixin):
self.assertFalse(self.portal.ERP5Site_isSupportRequestCreationClosed(
other_person.getRelativeUrl()))
def test_ERP5Site_isSupportRequestCreationClosed_submitted_state(self):
person = self._makePerson(self.new_id)
url = person.getRelativeUrl()
self.assertFalse(self.portal.ERP5Site_isSupportRequestCreationClosed(url))
self.assertFalse(self.portal.ERP5Site_isSupportRequestCreationClosed())
def newSupportRequest():
sr = self.portal.support_request_module.newContent(\
title="Test Support Request POIUY",
destination_decision=url)
sr.validate()
sr.suspend()
sr.immediateReindexObject()
# Create five tickets, the limit of ticket creation
newSupportRequest()
newSupportRequest()
newSupportRequest()
newSupportRequest()
newSupportRequest()
self.assertFalse(self.portal.ERP5Site_isSupportRequestCreationClosed(url))
self.assertFalse(self.portal.ERP5Site_isSupportRequestCreationClosed())
def test_Base_generateSupportRequestForSlapOS_recreate_if_closed(self):
title = "Test Support Request %s" % self.new_id
computer = self._makeComputer(self.new_id)
......
37
\ No newline at end of file
38
\ No newline at end of file
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