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
Titouan Soulard
slapos.core
Commits
c8c036f3
Commit
c8c036f3
authored
May 05, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: Update default Price
parent
1bbea36a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
26 deletions
+27
-26
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionCDNScenario.py
...components/test.erp5.testSlapOSSubscriptionCDNScenario.py
+7
-7
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
...al_components/test.erp5.testSlapOSSubscriptionScenario.py
+13
-12
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
...ortal_components/test.erp5.testSlapOSSubscriptionSkins.py
+7
-7
No files found.
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionCDNScenario.py
View file @
c8c036f3
...
@@ -25,19 +25,19 @@ class TestSlapOSSubscriptionCDNScenarioMixin(TestSlapOSSubscriptionScenarioMixin
...
@@ -25,19 +25,19 @@ class TestSlapOSSubscriptionCDNScenarioMixin(TestSlapOSSubscriptionScenarioMixin
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
TestSlapOSSubscriptionScenarioMixin
.
afterSetUp
(
self
)
TestSlapOSSubscriptionScenarioMixin
.
afterSetUp
(
self
)
self
.
expected_individual_price_without_tax
=
4.16666666667
self
.
expected_individual_price_without_tax
=
5
self
.
expected_individual_price_with_tax
=
5
.0
self
.
expected_individual_price_with_tax
=
6
.0
self
.
expected_reservation_fee
=
1.
0
self
.
expected_reservation_fee
=
1.
2
self
.
expected_reservation_fee_without_tax
=
0.833333333333333
self
.
expected_reservation_fee_without_tax
=
1
self
.
expected_reservation_quantity_tax
=
0.833333333333333
self
.
expected_reservation_quantity_tax
=
1.0
self
.
expected_reservation_tax
=
0.
166666666666667
self
.
expected_reservation_tax
=
0.
2
self
.
expected_price_currency
=
"currency_module/EUR"
self
.
expected_price_currency
=
"currency_module/EUR"
self
.
expected_zh_individual_price_without_tax
=
40
self
.
expected_zh_individual_price_without_tax
=
40
self
.
expected_zh_individual_price_with_tax
=
40.4
self
.
expected_zh_individual_price_with_tax
=
40.4
self
.
expected_zh_reservation_fee
=
8.08
self
.
expected_zh_reservation_fee
=
8.08
self
.
expected_zh_reservation_fee_without_tax
=
8.0
self
.
expected_zh_reservation_fee_without_tax
=
8.0
self
.
expected_zh_reservation_quantity_tax
=
8.0
8
self
.
expected_zh_reservation_quantity_tax
=
8.0
self
.
expected_zh_reservation_tax
=
0.08
self
.
expected_zh_reservation_tax
=
0.08
self
.
resource_variation_reference
=
"CDN"
self
.
resource_variation_reference
=
"CDN"
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
View file @
c8c036f3
...
@@ -31,12 +31,12 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
...
@@ -31,12 +31,12 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
self
.
unpinDateTime
()
self
.
unpinDateTime
()
self
.
normal_user
=
None
self
.
normal_user
=
None
self
.
expected_individual_price_without_tax
=
1
62.50
self
.
expected_individual_price_without_tax
=
1
95
self
.
expected_individual_price_with_tax
=
195.00
self
.
expected_individual_price_with_tax
=
234
self
.
expected_reservation_fee
=
25
.00
self
.
expected_reservation_fee
=
30
.00
self
.
expected_reservation_fee_without_tax
=
2
0.833333333333333
self
.
expected_reservation_fee_without_tax
=
2
5
self
.
expected_reservation_quantity_tax
=
2
0.833333333333333
self
.
expected_reservation_quantity_tax
=
2
5
self
.
expected_reservation_tax
=
4.166666666666667
self
.
expected_reservation_tax
=
5.0
self
.
expected_price_currency
=
"currency_module/EUR"
self
.
expected_price_currency
=
"currency_module/EUR"
...
@@ -412,7 +412,7 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
...
@@ -412,7 +412,7 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self
.
assertEqual
(
payment
.
getSourcePayment
(),
self
.
assertEqual
(
payment
.
getSourcePayment
(),
"%s/bank_account"
%
expected_source_section
)
"%s/bank_account"
%
expected_source_section
)
self
.
assertEqual
(
int
(
payment
.
PaymentTransaction_getTotalPayablePrice
(
)
*
100
),
self
.
assertEqual
(
int
(
round
(
payment
.
PaymentTransaction_getTotalPayablePrice
(),
2
)
*
100
),
-
authAmount
)
-
authAmount
)
self
.
assertEqual
(
payment
.
getPriceCurrency
(),
self
.
assertEqual
(
payment
.
getPriceCurrency
(),
...
@@ -601,8 +601,8 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
...
@@ -601,8 +601,8 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
# Pay with appropriate mode depending of the currency.
# Pay with appropriate mode depending of the currency.
if
payment
.
getPriceCurrency
()
==
"currency_module/CNY"
:
if
payment
.
getPriceCurrency
()
==
"currency_module/CNY"
:
self
.
assertEqual
(
-
self
.
expected_zh_reservation_fee
*
quantity
,
self
.
assertEqual
(
-
round
(
self
.
expected_zh_reservation_fee
*
quantity
,
2
)
,
payment
.
PaymentTransaction_getTotalPayablePrice
(
))
round
(
payment
.
PaymentTransaction_getTotalPayablePrice
(),
2
))
# Pay 188 CNY per VM
# Pay 188 CNY per VM
data_kw
=
{
data_kw
=
{
...
@@ -615,8 +615,8 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
...
@@ -615,8 +615,8 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
# Wechat_processUpdate will mark payment as payed by stopping it.
# Wechat_processUpdate will mark payment as payed by stopping it.
payment
.
PaymentTransaction_createWechatEvent
().
WechatEvent_processUpdate
(
data_kw
)
payment
.
PaymentTransaction_createWechatEvent
().
WechatEvent_processUpdate
(
data_kw
)
else
:
else
:
self
.
assertEqual
(
-
self
.
expected_reservation_fee
*
quantity
,
self
.
assertEqual
(
-
round
(
self
.
expected_reservation_fee
*
quantity
,
2
)
,
payment
.
PaymentTransaction_getTotalPayablePrice
(
))
round
(
payment
.
PaymentTransaction_getTotalPayablePrice
(),
2
))
# Pay 25 euros per VM
# Pay 25 euros per VM
data_kw
=
{
data_kw
=
{
...
@@ -734,7 +734,8 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
...
@@ -734,7 +734,8 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self
.
assertEqual
(
round
(
line
.
getTotalPrice
(),
2
),
self
.
assertEqual
(
round
(
line
.
getTotalPrice
(),
2
),
round
(
expected_reservation_tax
*
quantity
,
2
))
round
(
expected_reservation_tax
*
quantity
,
2
))
self
.
assertEqual
(
round
(
invoice
.
getTotalPrice
(),
2
),
expected_reservation_fee
*
quantity
)
self
.
assertEqual
(
round
(
invoice
.
getTotalPrice
(),
2
),
round
(
expected_reservation_fee
*
quantity
,
2
))
def
checkSecondMonthAggregatedSalePackingList
(
self
,
subscription_request
,
sale_packing_list
):
def
checkSecondMonthAggregatedSalePackingList
(
self
,
subscription_request
,
sale_packing_list
):
sale_packing_list_line
=
[
i
for
i
in
sale_packing_list
.
objectValues
()
sale_packing_list_line
=
[
i
for
i
in
sale_packing_list
.
objectValues
()
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
View file @
c8c036f3
...
@@ -488,9 +488,9 @@ class TestSubscriptionRequest_requestPaymentTransaction(TestSubscriptionSkinsMix
...
@@ -488,9 +488,9 @@ class TestSubscriptionRequest_requestPaymentTransaction(TestSubscriptionSkinsMix
for
line
in
current_payment
.
contentValues
():
for
line
in
current_payment
.
contentValues
():
if
line
.
getSource
()
==
"account_module/payment_to_encash"
:
if
line
.
getSource
()
==
"account_module/payment_to_encash"
:
self
.
assertEqual
(
line
.
getQuantity
(),
-
25
*
quantity
)
self
.
assertEqual
(
line
.
getQuantity
(),
-
30
*
quantity
)
if
line
.
getSource
()
==
"account_module/receivable"
:
if
line
.
getSource
()
==
"account_module/receivable"
:
self
.
assertEqual
(
line
.
getQuantity
(),
25
*
quantity
)
self
.
assertEqual
(
line
.
getQuantity
(),
30
*
quantity
)
def
_test_request_payment_transaction_chinese
(
self
,
quantity
):
def
_test_request_payment_transaction_chinese
(
self
,
quantity
):
email
=
"abc%s@nexedi.com"
%
self
.
new_id
email
=
"abc%s@nexedi.com"
%
self
.
new_id
...
@@ -518,13 +518,13 @@ class TestSubscriptionRequest_requestPaymentTransaction(TestSubscriptionSkinsMix
...
@@ -518,13 +518,13 @@ class TestSubscriptionRequest_requestPaymentTransaction(TestSubscriptionSkinsMix
for
line
in
current_payment
.
contentValues
():
for
line
in
current_payment
.
contentValues
():
if
line
.
getSource
()
==
"account_module/payment_to_encash"
:
if
line
.
getSource
()
==
"account_module/payment_to_encash"
:
self
.
assertEqual
(
line
.
getQuantity
(),
-
188
*
quantity
)
self
.
assertEqual
(
line
.
getQuantity
(),
-
18
9.8
8
*
quantity
)
if
line
.
getSource
()
==
"account_module/receivable"
:
if
line
.
getSource
()
==
"account_module/receivable"
:
self
.
assertEqual
(
line
.
getQuantity
(),
188
*
quantity
)
self
.
assertEqual
(
line
.
getQuantity
(),
18
9.8
8
*
quantity
)
@
simulate
(
'SubscriptionRequest_createRelatedSaleInvoiceTransaction'
,
'price, tag, payment, template, REQUEST=None'
,
"""assert REQUEST == None
@
simulate
(
'SubscriptionRequest_createRelatedSaleInvoiceTransaction'
,
'price, tag, payment, template, REQUEST=None'
,
"""assert REQUEST == None
assert payment
assert payment
assert price == 2
0.8333333
assert price == 2
5.0
assert tag == 'TAG'
assert tag == 'TAG'
assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate()"""
)
assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate()"""
)
def
test_request_payment_transaction_q1
(
self
):
def
test_request_payment_transaction_q1
(
self
):
...
@@ -532,7 +532,7 @@ assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubsc
...
@@ -532,7 +532,7 @@ assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubsc
@
simulate
(
'SubscriptionRequest_createRelatedSaleInvoiceTransaction'
,
'price, tag, payment, template, REQUEST=None'
,
"""assert REQUEST == None
@
simulate
(
'SubscriptionRequest_createRelatedSaleInvoiceTransaction'
,
'price, tag, payment, template, REQUEST=None'
,
"""assert REQUEST == None
assert payment
assert payment
assert price == 2
0.8333333
assert price == 2
5.0
assert tag == 'TAG'
assert tag == 'TAG'
assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate()"""
)
assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate()"""
)
def
test_request_payment_transaction_q2
(
self
):
def
test_request_payment_transaction_q2
(
self
):
...
@@ -540,7 +540,7 @@ assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubsc
...
@@ -540,7 +540,7 @@ assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubsc
@
simulate
(
'SubscriptionRequest_createRelatedSaleInvoiceTransaction'
,
'price, tag, payment, template, REQUEST=None'
,
"""assert REQUEST == None
@
simulate
(
'SubscriptionRequest_createRelatedSaleInvoiceTransaction'
,
'price, tag, payment, template, REQUEST=None'
,
"""assert REQUEST == None
assert payment
assert payment
assert price == 2
0.8333333
assert price == 2
5.0
assert tag == 'TAG'
assert tag == 'TAG'
assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate()"""
)
assert template == context.portal_preferences.getPreferredDefaultPrePaymentSubscriptionInvoiceTemplate()"""
)
def
test_request_payment_transaction_q10
(
self
):
def
test_request_payment_transaction_q10
(
self
):
...
...
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