Commit 372fc666 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_subscription_request: (Test) Verify as Manager

   The asserts and verification should be done as manager to present set unecessary security roles.
parent 1782abcf
...@@ -428,14 +428,14 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans ...@@ -428,14 +428,14 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self.assertEqual(len(delivery_list), 1) self.assertEqual(len(delivery_list), 1)
sale_packing_list = delivery_list[0] sale_packing_list = delivery_list[0]
grouping_reference = sale_packing_list.getReference()
subscription_delivery_line_list = self.portal.portal_catalog( subscription_delivery_line_list = self.portal.portal_catalog(
portal_type="Sale Packing List Line", portal_type="Sale Packing List Line",
grouping_reference=grouping_reference default_resource_uid=self.portal.service_module.slapos_instance_subscription.getUid(),
grouping_reference=sale_packing_list.getReference()
) )
self.assertEqual(len(subscription_delivery_line_list), 1) self.assertEqual(len(subscription_delivery_line_list), 1,
"len(%s) is not 1" % [i.getObject() for i in subscription_delivery_line_list])
# Check more :) # Check more :)
return payment return payment
...@@ -448,15 +448,16 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans ...@@ -448,15 +448,16 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self.login(person.getUserId()) self.login(person.getUserId())
self.usePayzenManually(self.web_site, person.getUserId(), is_email_expected=False) self.usePayzenManually(self.web_site, person.getUserId(), is_email_expected=False)
self.logout()
self.login()
# 195 is the month payment # 195 is the month payment
# 195*1 is the 1 months to pay upfront to use. # 195*1 is the 1 months to pay upfront to use.
# 25 is the reservation fee deduction. # 25 is the reservation fee deduction.
authAmount = (int(self.expected_individual_price_with_tax*100)*1-int(self.expected_reservation_fee*100))*quantity authAmount = (int(self.expected_individual_price_with_tax*100)*1-int(self.expected_reservation_fee*100))*quantity
payment = self.checkSubscriptionRequestPayment(subscription_request, authAmount) payment = self.checkSubscriptionRequestPayment(subscription_request, authAmount)
self.logout()
self.login()
data_kw = { data_kw = {
"status": "SUCCESS", "status": "SUCCESS",
"answer": { "answer": {
...@@ -485,12 +486,12 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans ...@@ -485,12 +486,12 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self.login(person.getUserId()) self.login(person.getUserId())
self.usePayzenManually(self.web_site, person.getUserId()) self.usePayzenManually(self.web_site, person.getUserId())
authAmount = int(self.expected_individual_price_with_tax*100)*quantity
payment = self.checkSubscriptionRequestPayment(subscription_request, authAmount)
self.logout() self.logout()
self.login() self.login()
authAmount = int(self.expected_individual_price_with_tax*100)*quantity
payment = self.checkSubscriptionRequestPayment(subscription_request, authAmount)
data_kw = { data_kw = {
"status": "SUCCESS", "status": "SUCCESS",
"answer": { "answer": {
...@@ -524,12 +525,12 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans ...@@ -524,12 +525,12 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self.login(person.getUserId()) self.login(person.getUserId())
self.useWechatManually(self.web_site, person.getUserId(), is_email_expected=False) self.useWechatManually(self.web_site, person.getUserId(), is_email_expected=False)
authAmount = (int(self.expected_zh_individual_price_with_tax*100)*1-int(self.expected_zh_reservation_fee*100))*quantity
payment = self.checkSubscriptionRequestPayment(subscription_request, authAmount)
self.logout() self.logout()
self.login() self.login()
authAmount = (int(self.expected_zh_individual_price_with_tax*100)*1-int(self.expected_zh_reservation_fee*100))*quantity
payment = self.checkSubscriptionRequestPayment(subscription_request, authAmount)
data_kw = { data_kw = {
'result_code': 'SUCCESS', 'result_code': 'SUCCESS',
'trade_state': 'SUCCESS', 'trade_state': 'SUCCESS',
...@@ -556,12 +557,12 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans ...@@ -556,12 +557,12 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self.login(person.getUserId()) self.login(person.getUserId())
self.useWechatManually(self.web_site, person.getUserId()) self.useWechatManually(self.web_site, person.getUserId())
authAmount = int(self.expected_zh_individual_price_with_tax*100)*quantity
payment = self.checkSubscriptionRequestPayment(subscription_request, authAmount)
self.logout() self.logout()
self.login() self.login()
authAmount = int(self.expected_zh_individual_price_with_tax*100)*quantity
payment = self.checkSubscriptionRequestPayment(subscription_request, authAmount)
data_kw = { data_kw = {
'result_code': 'SUCCESS', 'result_code': 'SUCCESS',
'trade_state': 'SUCCESS', 'trade_state': 'SUCCESS',
......
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