Commit a63fc26f authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_subscription_request: New test for check if invoices are generated for the second month

parent ecc697f5
...@@ -178,6 +178,47 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans ...@@ -178,6 +178,47 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self._dropPaymentTransaction_getVADSUrlDict() self._dropPaymentTransaction_getVADSUrlDict()
self.portal.portal_secure_payments.slapos_wechat_test.setWechatMode(original_mode) self.portal.portal_secure_payments.slapos_wechat_test.setWechatMode(original_mode)
def checkAndPaySecondMonth(self, subscription_request):
self.login()
original_mode = self.portal.portal_secure_payments.slapos_wechat_test.getWechatMode()
self._simulatePaymentTransaction_getVADSUrlDict()
try:
person = subscription_request.getDestinationSectionValue()
quantity = subscription_request.getQuantity()
self.portal.portal_secure_payments.slapos_wechat_test.setWechatMode("UNITTEST")
self.login(person.getUserId())
self.useWechatManually(self.web_site, person.getUserId())
payment = self.portal.portal_catalog.getResultValue(
portal_type="Payment Transaction",
simulation_state="started")
authAmount = int(self.expected_individual_price_with_tax*100)*quantity
self.assertEqual(int(payment.PaymentTransaction_getTotalPayablePrice()*100),
-authAmount)
self.assertEqual(payment.getPriceCurrency(), self.expected_price_currency)
self.logout()
self.login()
data_kw = {
'result_code': 'SUCCESS',
'trade_state': 'SUCCESS',
'total_fee': authAmount,
'fee_type': 'CNY',
}
# Wechat_processUpdate will mark payment as payed by stopping it.
payment.PaymentTransaction_createWechatEvent().WechatEvent_processUpdate(data_kw)
finally:
self._dropPaymentTransaction_getVADSUrlDict()
self.portal.portal_secure_payments.slapos_wechat_test.setWechatMode(original_mode)
class TestSlapOSSubscriptionChineseScenario(TestSlapOSSubscriptionChineseScenarioMixin): class TestSlapOSSubscriptionChineseScenario(TestSlapOSSubscriptionChineseScenarioMixin):
......
...@@ -22,10 +22,12 @@ ...@@ -22,10 +22,12 @@
from erp5.component.test.SlapOSTestCaseDefaultScenarioMixin import DefaultScenarioMixin from erp5.component.test.SlapOSTestCaseDefaultScenarioMixin import DefaultScenarioMixin
from erp5.component.test.SlapOSTestCaseMixin import changeSkin from erp5.component.test.SlapOSTestCaseMixin import changeSkin
from DateTime import DateTime from DateTime import DateTime
import datetime
class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
def afterSetUp(self): def afterSetUp(self):
self.unpinDateTime()
self.normal_user = None self.normal_user = None
self.expected_individual_price_without_tax = 162.50 self.expected_individual_price_without_tax = 162.50
self.expected_individual_price_with_tax = 195.00 self.expected_individual_price_with_tax = 195.00
...@@ -39,6 +41,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -39,6 +41,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.expected_source_section = "organisation_module/slapos" self.expected_source_section = "organisation_module/slapos"
self.cloud_invitation_token = None self.cloud_invitation_token = None
self.expected_free_reservation = 0 self.expected_free_reservation = 0
self.skip_destroy_and_check = 0
self.login() self.login()
self.portal.portal_alarms.slapos_subscription_request_process_draft.setEnabled(True) self.portal.portal_alarms.slapos_subscription_request_process_draft.setEnabled(True)
...@@ -60,6 +63,9 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -60,6 +63,9 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
# One user to create computers to deploy the subscription # One user to create computers to deploy the subscription
self.createAdminUser() self.createAdminUser()
self.cleanUpNotificationMessage() self.cleanUpNotificationMessage()
self.portal.portal_catalog.searchAndActivate(
portal_type='Active Process',
method_id='ActiveProcess_deleteSelf')
self.tic() self.tic()
self.createNotificationMessage("subscription_request-confirmation-with-password") self.createNotificationMessage("subscription_request-confirmation-with-password")
...@@ -434,6 +440,232 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -434,6 +440,232 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.assertEqual(round(invoice.getTotalPrice(), 2), self.expected_reservation_fee*quantity) self.assertEqual(round(invoice.getTotalPrice(), 2), self.expected_reservation_fee*quantity)
def checkSecondMonthAggregatedSalePackingList(self, subscription_request, sale_packing_list):
sale_packing_list_line = [ i for i in sale_packing_list.objectValues()
if i.getResource() == "service_module/slapos_instance_subscription"][0]
quantity = subscription_request.getQuantity()
# The values are without tax
self.assertEqual(sale_packing_list_line.getQuantity(), 1*quantity)
self.assertEqual(round(sale_packing_list_line.getPrice(), 2),
round(self.expected_individual_price_without_tax, 2))
self.assertEqual(round(sale_packing_list_line.getTotalPrice(), 2),
round(1*self.expected_individual_price_without_tax*quantity, 2))
self.assertEqual(sale_packing_list.getCausality(),
subscription_request.getRelativeUrl())
self.assertEqual(sale_packing_list.getCausality(),
subscription_request.getRelativeUrl())
self.assertEqual(sale_packing_list.getPriceCurrency(),
self.expected_price_currency)
def _checkSecondMonthSimulation(self, subscription_request_list,
default_email_text, subscription_server):
# Needed?
self.simulateSlapgridCP(subscription_server)
self.tic()
self.stepCallSlaposUpdateOpenSaleOrderPeriodAlarm()
self.tic()
for subscription_request in subscription_request_list:
self.checkAllocationOnRelatedInstance(subscription_request)
# Needed?
self.simulateSlapgridCP(subscription_server)
self.tic()
# generate simulation for open order
self.stepCallUpdateOpenOrderSimulationAlarm(full=1)
self.tic()
# build subscription packing list
self.stepCallSlaposTriggerBuildAlarm()
self.tic()
# stabilise build deliveries and expand them
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# build aggregated packing list
self.stepCallSlaposTriggerAggregatedDeliveryOrderBuilderAlarm()
self.tic()
# stabilise aggregated deliveries and expand them
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# check if Packing list is generated with the right trade condition
preference_tool = self.portal.portal_preferences
specialise_subscription_uid = preference_tool.getPreferredAggregatedSubscriptionSaleTradeCondition()
specialise_uid = preference_tool.getPreferredAggregatedSaleTradeCondition()
for subscription_request in subscription_request_list:
sale_packing_list_list = self.getAggregatedSalePackingList(
subscription_request, specialise_subscription_uid)
if not len(sale_packing_list_list):
diverged_sale_packing_list_list = self.getDivergedAggregatedSalePackingList(
subscription_request, specialise_subscription_uid)
self.assertEqual(0, len(diverged_sale_packing_list_list))
self.assertEqual(1, len(sale_packing_list_list))
self.checkSecondMonthAggregatedSalePackingList(subscription_request, sale_packing_list_list[0])
expected_sale_packing_list_amount = len(subscription_request_list) * 2
self.assertEqual(expected_sale_packing_list_amount,
len(self.getSubscriptionSalePackingList(subscription_request)))
self.assertEqual(0, len(self.getAggregatedSalePackingList(
subscription_request, specialise_uid)))
# Call this alarm shouldn't affect the delivery
self.stepCallSlaposStartConfirmedAggregatedSalePackingListAlarm(
accounting_date=DateTime('2222/01/01'))
self.tic()
for subscription_request in subscription_request_list:
self.assertEqual(1, len(self.getAggregatedSalePackingList(
subscription_request, specialise_subscription_uid)))
# Call this alarm shouldn't affect the delivery
self.stepCallSlaposStartConfirmedAggregatedSubscriptionSalePackingListAlarm()
self.tic()
for subscription_request in subscription_request_list:
self.assertEqual(0, len(self.getAggregatedSalePackingList(
subscription_request, specialise_uid)))
# stabilise aggregated deliveries and expand them
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# deliver aggregated deliveries
self.stepCallSlaposDeliverStartedAggregatedSalePackingListAlarm()
self.tic()
# stabilise aggregated deliveries and expand them
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# build aggregated invoices
self.stepCallSlaposTriggerBuildAlarm()
self.tic()
# stabilise aggregated invoices and expand them
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# update invoices with their tax & discount
self.stepCallSlaposTriggerBuildAlarm()
self.tic()
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# update invoices with their tax & discount transaction lines
self.stepCallSlaposTriggerBuildAlarm()
self.tic()
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# stop the invoices and solve them again
self.stepCallSlaposStopConfirmedAggregatedSaleInvoiceTransactionAlarm()
self.tic()
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
builder = self.portal.portal_orders.slapos_payment_transaction_builder
for _ in range(500):
# build the aggregated payment
self.stepCallSlaposTriggerPaymentTransactionOrderBuilderAlarm()
self.tic()
# If there is something unbuild recall alarm.
if not len(builder.OrderBuilder_generateUnrelatedInvoiceList()):
break
# start the payzen payment
self.stepCallSlaposPayzenUpdateConfirmedPaymentAlarm()
self.tic()
# stabilise the payment deliveries and expand them
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# trigger the CRM interaction
self.stepCallSlaposCrmCreateRegularisationRequestAlarm()
self.tic()
# Test if balance is bad now
subscriber = subscription_request.getDestinationSectionValue()
self.assertEqual(subscriber.Entity_statOutstandingAmount(at_date=DateTime()),
0.0)
expected_amount = round(self.expected_individual_price_with_tax*sum([i.getQuantity(0)
for i in subscription_request_list]),2)
self.assertEqual(round(subscriber.Entity_statOutstandingAmount(), 2), expected_amount)
# Invoice to Pay
self.assertEqual(
round(subscriber.Entity_statSlapOSOutstandingAmount(at_date=DateTime()+20), 2),
expected_amount)
# Pay this new invoice
for subscription_request in subscription_request_list:
self.checkAndPaySecondMonth(subscription_request)
self.tic()
# Here the invoice was payed before the date, so value is negative.
self.assertEqual(round(subscriber.Entity_statOutstandingAmount(at_date=DateTime()), 2),
-expected_amount)
self.assertEqual(round(subscriber.Entity_statOutstandingAmount(), 2), 0.0)
# All payed
self.assertEqual(
round(subscriber.Entity_statSlapOSOutstandingAmount(at_date=DateTime()+20), 2),
0.0)
def checkAndPaySecondMonth(self, subscription_request):
self.login()
person = subscription_request.getDestinationSectionValue()
quantity = subscription_request.getQuantity()
self.login(person.getUserId())
self.usePayzenManually(self.web_site, person.getUserId())
payment = self.portal.portal_catalog.getResultValue(
portal_type="Payment Transaction",
simulation_state="started")
authAmount = int(self.expected_individual_price_with_tax*100)*quantity
self.assertEqual(payment.getSourceSection(), self.expected_source_section)
self.assertEqual(payment.getSourcePayment(),
"%s/bank_account" % self.expected_source_section)
self.assertEqual(int(payment.PaymentTransaction_getTotalPayablePrice()*100),
-authAmount)
self.assertEqual(payment.getPriceCurrency(), self.expected_price_currency)
self.logout()
self.login()
data_kw = {
'errorCode': '0',
'transactionStatus': '6',
'authAmount': authAmount,
'authDevise': '978',
}
payment.PaymentTransaction_createPayzenEvent().PayzenEvent_processUpdate(data_kw, True)
def checkBootstrapUser(self, subscription_request): def checkBootstrapUser(self, subscription_request):
person = subscription_request.getDestinationSectionValue(portal_type="Person") person = subscription_request.getDestinationSectionValue(portal_type="Person")
self.assertEqual(person.getDefaultEmailText(), self.assertEqual(person.getDefaultEmailText(),
...@@ -533,6 +765,9 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -533,6 +765,9 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.assertNotEqual(instance.getAggregate(), None) self.assertNotEqual(instance.getAggregate(), None)
def checkAggregatedSalePackingList(self, subscription_request, sale_packing_list): def checkAggregatedSalePackingList(self, subscription_request, sale_packing_list):
self.assertEqual(len(sale_packing_list.objectValues()), 2)
sale_packing_list_line = [ i for i in sale_packing_list.objectValues() sale_packing_list_line = [ i for i in sale_packing_list.objectValues()
if i.getResource() == "service_module/slapos_instance_subscription"][0] if i.getResource() == "service_module/slapos_instance_subscription"][0]
...@@ -603,6 +838,18 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -603,6 +838,18 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
destination_decision_uid=person_uid, destination_decision_uid=person_uid,
specialise_uid=specialise_uid) specialise_uid=specialise_uid)
def getDivergedAggregatedSalePackingList(self, subscription_request, specialise):
person_uid = subscription_request.getDestinationSectionValue().getUid()
specialise_uid = self.portal.restrictedTraverse(specialise).getUid()
return self.portal.portal_catalog(
portal_type='Sale Packing List',
simulation_state='confirmed',
causality_state='diverged',
causality_uid=subscription_request.getUid(),
destination_decision_uid=person_uid,
specialise_uid=specialise_uid)
def getSubscriptionSalePackingList(self, subscription_request): def getSubscriptionSalePackingList(self, subscription_request):
person_uid = subscription_request.getDestinationSectionValue().getUid() person_uid = subscription_request.getDestinationSectionValue().getUid()
specialise_uid = self.portal.restrictedTraverse( specialise_uid = self.portal.restrictedTraverse(
...@@ -753,6 +1000,9 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -753,6 +1000,9 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
specialise_uid = preference_tool.getPreferredAggregatedSaleTradeCondition() specialise_uid = preference_tool.getPreferredAggregatedSaleTradeCondition()
for subscription_request in subscription_request_list: for subscription_request in subscription_request_list:
hosting_subscription = subscription_request.getAggregateValue()
self.assertEqual(hosting_subscription.getCausalityState(), "solved")
sale_packing_list_list = self.getAggregatedSalePackingList( sale_packing_list_list = self.getAggregatedSalePackingList(
subscription_request, specialise_subscription_uid) subscription_request, specialise_subscription_uid)
self.assertEqual(1, len(sale_packing_list_list)) self.assertEqual(1, len(sale_packing_list_list))
...@@ -961,6 +1211,10 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -961,6 +1211,10 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
default_email_text, self.subscription_condition) default_email_text, self.subscription_condition)
def destroyAndCheckSubscription(self, default_email_text, subscription_server): def destroyAndCheckSubscription(self, default_email_text, subscription_server):
if self.skip_destroy_and_check:
return
subscription_request_list = self.getSubscriptionRequestList( subscription_request_list = self.getSubscriptionRequestList(
default_email_text, self.subscription_condition) default_email_text, self.subscription_condition)
...@@ -1171,6 +1425,28 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -1171,6 +1425,28 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
return default_email_text, name return default_email_text, name
def _test_second_month_scenario(self, default_email_text):
subscription_request_list = self.getSubscriptionRequestList(
default_email_text, self.subscription_condition)
# Ensure periodicity is correct
for subscription_request in subscription_request_list:
hosting_subscription = subscription_request.getAggregateValue()
self.assertEqual(hosting_subscription.getPeriodicityMonthDay(),
DateTime().day())
self.pinDateTime(DateTime(DateTime().asdatetime() + datetime.timedelta(days=17)))
self.addCleanup(self.unpinDateTime)
self._checkSecondMonthSimulation(subscription_request_list,
default_email_text, self.subscription_server)
self.skip_destroy_and_check = 0
self.destroyAndCheckSubscription(
default_email_text, self.subscription_server
)
class TestSlapOSSubscriptionScenario(TestSlapOSSubscriptionScenarioMixin): class TestSlapOSSubscriptionScenario(TestSlapOSSubscriptionScenarioMixin):
......
# -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (c) 2019 Nexedi SA and Contributors. All Rights Reserved.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from erp5.component.test.testSlapOSSubscriptionChineseScenario import TestSlapOSSubscriptionChineseScenarioMixin
class testSlapOSSubscriptionSecondMonthPaymentScenario(TestSlapOSSubscriptionChineseScenarioMixin):
def test_subscription_scenario_with_single_vm(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_subscription_scenario(amount=1)
self._test_second_month_scenario(default_email_text)
def test_subscription_with_3_vms_scenario(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_subscription_scenario(amount=3)
self._test_second_month_scenario(default_email_text)
def test_subscription_scenario_with_reversal_transaction(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_subscription_scenario_with_reversal_transaction(amount=1)
self._test_second_month_scenario(default_email_text)
def test_two_subscription_scenario(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_two_subscription_scenario(amount=1)
self._test_second_month_scenario(default_email_text)
def test_subscription_scenario_with_existing_chienese_user(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_subscription_scenario_with_existing_user(amount=1, language="zh")
self._test_second_month_scenario(default_email_text)
def test_subscription_scenario_with_existing_english_user(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_subscription_scenario_with_existing_user(amount=1, language="en")
self._test_second_month_scenario(default_email_text)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSSubscriptionSecondMonthPaymentChineseScenario</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSSubscriptionSecondMonthPaymentChineseScenario</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (c) 2019 Nexedi SA and Contributors. All Rights Reserved.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from erp5.component.test.testSlapOSSubscriptionScenario import TestSlapOSSubscriptionScenarioMixin
class testSlapOSSubscriptionSecondMonthPaymentScenario(TestSlapOSSubscriptionScenarioMixin):
def test_subscription_scenario_with_single_vm(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_subscription_scenario(amount=1)
self._test_second_month_scenario(default_email_text)
def test_subscription_with_3_vms_scenario(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_subscription_scenario(amount=3)
self._test_second_month_scenario(default_email_text)
def test_subscription_scenario_with_reversal_transaction(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_subscription_scenario_with_reversal_transaction(amount=1)
self._test_second_month_scenario(default_email_text)
def test_two_subscription_scenario(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_two_subscription_scenario(amount=1)
self._test_second_month_scenario(default_email_text)
def test_subscription_scenario_with_existing_chienese_user(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_subscription_scenario_with_existing_user(amount=1, language="zh")
self._test_second_month_scenario(default_email_text)
def test_subscription_scenario_with_existing_english_user(self):
self.skip_destroy_and_check = 1
default_email_text, _ = self._test_subscription_scenario_with_existing_user(amount=1, language="en")
self._test_second_month_scenario(default_email_text)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSSubscriptionSecondMonthPaymentScenario</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSSubscriptionSecondMonthPaymentScenario</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -8,4 +8,6 @@ test.erp5.testSlapOSSubscriptionChineseScenario ...@@ -8,4 +8,6 @@ test.erp5.testSlapOSSubscriptionChineseScenario
test.erp5.testSlapOSSubscriptionNewTemplateScenario test.erp5.testSlapOSSubscriptionNewTemplateScenario
test.erp5.testSlapOSSubscriptionNewTemplateChineseScenario test.erp5.testSlapOSSubscriptionNewTemplateChineseScenario
test.erp5.testSlapOSSubscriptionInvitationTokenScenario test.erp5.testSlapOSSubscriptionInvitationTokenScenario
test.erp5.testSlapOSSubscriptionInvitationTokenChineseScenario test.erp5.testSlapOSSubscriptionInvitationTokenChineseScenario
\ No newline at end of file test.erp5.testSlapOSSubscriptionSecondMonthPaymentScenario
test.erp5.testSlapOSSubscriptionSecondMonthPaymentChineseScenario
\ 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