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
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
c9f03d44
Commit
c9f03d44
authored
Apr 16, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: Update test since the API changed
parent
c1baaf12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
21 deletions
+35
-21
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionCancellationScenario.py
...s/test.erp5.testSlapOSSubscriptionCancellationScenario.py
+12
-10
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionDualOrganisationScenario.py
...st.erp5.testSlapOSSubscriptionDualOrganisationScenario.py
+6
-5
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
...ortal_components/test.erp5.testSlapOSSubscriptionSkins.py
+17
-6
No files found.
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionCancellationScenario.py
View file @
c9f03d44
...
...
@@ -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
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionDualOrganisationScenario.py
View file @
c9f03d44
...
...
@@ -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
:
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
View file @
c9f03d44
...
...
@@ -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"
...
...
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