Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.core
Commits
a63fc26f
Commit
a63fc26f
authored
Sep 21, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: New test for check if invoices are generated for the second month
parent
ecc697f5
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
684 additions
and
1 deletion
+684
-1
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionChineseScenario.py
...onents/test.erp5.testSlapOSSubscriptionChineseScenario.py
+41
-0
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
...al_components/test.erp5.testSlapOSSubscriptionScenario.py
+276
-0
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSecondMonthPaymentChineseScenario.py
...estSlapOSSubscriptionSecondMonthPaymentChineseScenario.py
+55
-0
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSecondMonthPaymentChineseScenario.xml
...stSlapOSSubscriptionSecondMonthPaymentChineseScenario.xml
+127
-0
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSecondMonthPaymentScenario.py
....erp5.testSlapOSSubscriptionSecondMonthPaymentScenario.py
+55
-0
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSecondMonthPaymentScenario.xml
...erp5.testSlapOSSubscriptionSecondMonthPaymentScenario.xml
+127
-0
master/bt5/slapos_subscription_request/bt/template_test_id_list
.../bt5/slapos_subscription_request/bt/template_test_id_list
+3
-1
No files found.
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionChineseScenario.py
View file @
a63fc26f
...
...
@@ -178,6 +178,47 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self
.
_dropPaymentTransaction_getVADSUrlDict
()
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
):
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
View file @
a63fc26f
This diff is collapsed.
Click to expand it.
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSecondMonthPaymentChineseScenario.py
0 → 100644
View file @
a63fc26f
# -*- 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
)
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSecondMonthPaymentChineseScenario.xml
0 → 100644
View file @
a63fc26f
<?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>
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSecondMonthPaymentScenario.py
0 → 100644
View file @
a63fc26f
# -*- 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
)
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSecondMonthPaymentScenario.xml
0 → 100644
View file @
a63fc26f
<?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>
master/bt5/slapos_subscription_request/bt/template_test_id_list
View file @
a63fc26f
...
...
@@ -8,4 +8,6 @@ test.erp5.testSlapOSSubscriptionChineseScenario
test.erp5.testSlapOSSubscriptionNewTemplateScenario
test.erp5.testSlapOSSubscriptionNewTemplateChineseScenario
test.erp5.testSlapOSSubscriptionInvitationTokenScenario
test.erp5.testSlapOSSubscriptionInvitationTokenChineseScenario
\ No newline at end of file
test.erp5.testSlapOSSubscriptionInvitationTokenChineseScenario
test.erp5.testSlapOSSubscriptionSecondMonthPaymentScenario
test.erp5.testSlapOSSubscriptionSecondMonthPaymentChineseScenario
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment