Commit 8e8d9cda authored by Romain Courteaud's avatar Romain Courteaud

slapos_subscription_request: test slapos_subscription_request_validate_submitted

parent fba4f450
......@@ -23,7 +23,11 @@ from erp5.component.test.SlapOSTestCaseMixin import \
class TestSlapOSSubscriptionRequestProcessAlarm(SlapOSTestCaseMixin):
#################################################################
# slapos_subscription_request_create_from_orphaned_item
#################################################################
def _test_alarm_slapos_subscription_request_create_from_orphaned_item(self, portal_type):
self.portal.testromain()
script_name = "Item_createSubscriptionRequest"
alarm = self.portal.portal_alarms.slapos_subscription_request_create_from_orphaned_item
......@@ -63,8 +67,42 @@ class TestSlapOSSubscriptionRequestProcessAlarm(SlapOSTestCaseMixin):
)
self._test_alarm(alarm, document, script_name)
def test_alarm_slapos_subscription_request_create_from_orphaned_instance_tree(self):
def test_Item_createSubscriptionRequest_alarm_fromOrphanedInstanceTree(self):
self._test_alarm_slapos_subscription_request_create_from_orphaned_item("Instance Tree")
def test_alarm_slapos_subscription_request_create_from_orphaned_compute_node(self):
def test_Item_createSubscriptionRequest_alarm_fromOrphanedComputeNode(self):
self._test_alarm_slapos_subscription_request_create_from_orphaned_item("Compute Node")
def test_Item_createSubscriptionRequest_alarm_fromOrphanedProject(self):
portal_type = 'Project'
script_name = "Item_createSubscriptionRequest"
alarm = self.portal.portal_alarms.slapos_subscription_request_create_from_orphaned_item
document = self.portal.getDefaultModule(portal_type).newContent(
portal_type=portal_type,
title="Test %s no subscription %s" % (portal_type, self.new_id)
)
self._test_alarm_not_visited(alarm, document, script_name)
class TestSlapOSSubscriptionRequestValidateAlarm(SlapOSTestCaseMixin):
#################################################################
# slapos_subscription_request_validate_submitted
#################################################################
def _createSubscriptionRequest(self):
return self.portal.subscription_request_module.newContent(
portal_type='Subscription Request',
title="Test subscription %s" % (self.generateNewId())
)
def test_SubscriptionRequest_validateIfSubmitted_alarm_notSubmitted(self):
script_name = "SubscriptionRequest_validateIfSubmitted"
alarm = self.portal.portal_alarms.slapos_subscription_request_validate_submitted
self._test_alarm_not_visited(alarm, self._createSubscriptionRequest(), script_name)
def test_SubscriptionRequest_validateIfSubmitted_alarm_submitted(self):
self.portal.testromain()
script_name = "SubscriptionRequest_validateIfSubmitted"
alarm = self.portal.portal_alarms.slapos_subscription_request_validate_submitted
subscription_request = self._createSubscriptionRequest()
self.portal.portal_workflow._jumpToStateFor(subscription_request, 'submitted')
self._test_alarm(alarm, subscription_request, script_name)
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