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