Commit c9f03d44 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_subscription_request: Update test since the API changed

parent c1baaf12
...@@ -58,13 +58,14 @@ class TestSlapOSSubscriptionCancellationScenario(TestSlapOSSubscriptionScenarioM ...@@ -58,13 +58,14 @@ class TestSlapOSSubscriptionCancellationScenario(TestSlapOSSubscriptionScenarioM
amount = 1 amount = 1
self.logout() self.logout()
user_input_dict = {
"name": name,
"amount" : amount}
self._requestSubscription( self._requestSubscription(
subscription_reference=self.subscription_condition.getReference(), subscription_reference=self.subscription_condition.getReference(),
amount=amount, user_input_dict=user_input_dict,
name=name, email=default_email_text,
default_email_text=default_email_text, confirmation_required=False)
confirmation_required=False,
REQUEST=self.portal.REQUEST)
self.login() self.login()
# I'm not sure if this is realistic # I'm not sure if this is realistic
...@@ -116,13 +117,14 @@ class TestSlapOSSubscriptionCancellationScenario(TestSlapOSSubscriptionScenarioM ...@@ -116,13 +117,14 @@ class TestSlapOSSubscriptionCancellationScenario(TestSlapOSSubscriptionScenarioM
amount = 1 amount = 1
self.logout() self.logout()
user_input_dict = {
"name": name,
"amount" : amount}
self._requestSubscription( self._requestSubscription(
subscription_reference=self.subscription_condition.getReference(), subscription_reference=self.subscription_condition.getReference(),
amount=amount, user_input_dict=user_input_dict,
name=name, email=default_email_text,
default_email_text=default_email_text, confirmation_required=False)
confirmation_required=False,
REQUEST=self.portal.REQUEST)
self.login() self.login()
# I'm not sure if this is realistic # I'm not sure if this is realistic
......
...@@ -59,13 +59,14 @@ class testSlapOSSubscriptionDualOrganisationScenario(TestSlapOSSubscriptionScena ...@@ -59,13 +59,14 @@ class testSlapOSSubscriptionDualOrganisationScenario(TestSlapOSSubscriptionScena
self.logout() self.logout()
user_input_dict = {
"name": name,
"amount" : amount}
request_kw = dict( request_kw = dict(
subscription_reference=self.subscription_condition.getReference(), subscription_reference=self.subscription_condition.getReference(),
amount=amount, user_input_dict=user_input_dict,
name=name, email=default_email_text,
default_email_text=default_email_text, confirmation_required=False)
confirmation_required=False,
REQUEST=self.portal.REQUEST)
all_subscription_requested_list = [] all_subscription_requested_list = []
for language in language_list: for language in language_list:
......
...@@ -1066,6 +1066,14 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin): ...@@ -1066,6 +1066,14 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin):
root_slave=False, root_slave=False,
source_reference="test_for_test_123") source_reference="test_for_test_123")
self.tic()
self.assertEqual(
subscription_request.SubscriptionRequest_processOrdered(),
None)
subscription_request.plan()
subscription_request.order()
self.tic() self.tic()
self.assertEqual( self.assertEqual(
subscription_request.SubscriptionRequest_processOrdered(), subscription_request.SubscriptionRequest_processOrdered(),
...@@ -1110,7 +1118,7 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin): ...@@ -1110,7 +1118,7 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin):
self.assertEqual( self.assertEqual(
subscription_request.getSimulationState(), subscription_request.getSimulationState(),
"draft" "ordered"
) )
@simulate('SubscriptionRequest_verifyPaymentBalanceIsReady', '*args, **kwrgs', 'return None') @simulate('SubscriptionRequest_verifyPaymentBalanceIsReady', '*args, **kwrgs', 'return None')
...@@ -1141,6 +1149,13 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin): ...@@ -1141,6 +1149,13 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin):
current_payment = subscription_request.SubscriptionRequest_requestPaymentTransaction("TAG", "en") current_payment = subscription_request.SubscriptionRequest_requestPaymentTransaction("TAG", "en")
self.assertNotEqual(current_payment, None) self.assertNotEqual(current_payment, None)
self.tic()
self.assertEqual(
subscription_request.SubscriptionRequest_processOrdered(), None)
subscription_request.plan()
subscription_request.order()
self.tic() self.tic()
self.assertEqual( self.assertEqual(
subscription_request.SubscriptionRequest_processOrdered(), 'Skipped (Instance Requested)') subscription_request.SubscriptionRequest_processOrdered(), 'Skipped (Instance Requested)')
...@@ -1181,7 +1196,7 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin): ...@@ -1181,7 +1196,7 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin):
self.assertEqual( self.assertEqual(
subscription_request.getSimulationState(), subscription_request.getSimulationState(),
"draft" "ordered"
) )
@simulate('SubscriptionRequest_verifyPaymentBalanceIsReady', '*args, **kwrgs', 'return context.fake_payment') @simulate('SubscriptionRequest_verifyPaymentBalanceIsReady', '*args, **kwrgs', 'return context.fake_payment')
...@@ -1237,10 +1252,6 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin): ...@@ -1237,10 +1252,6 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin):
self.tic() self.tic()
self.assertEqual('solved', hosting_subscription.getCausalityState()) self.assertEqual('solved', hosting_subscription.getCausalityState())
self.assertEqual(
subscription_request.SubscriptionRequest_processOrdered(), "Skipped (User isn't notified)")
self.tic()
self.assertEqual( self.assertEqual(
subscription_request.getSimulationState(), subscription_request.getSimulationState(),
"confirmed" "confirmed"
......
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