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
Lu Xu
slapos.core
Commits
75a80515
Commit
75a80515
authored
Jan 06, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run tests for slapos_subscription_request
parent
88df600e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
3 deletions
+61
-3
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionAlarm.py
...ortal_components/test.erp5.testSlapOSSubscriptionAlarm.py
+3
-3
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSTrialSkins.py
...eItem/portal_components/test.erp5.testSlapOSTrialSkins.py
+57
-0
master/tests/__init__.py
master/tests/__init__.py
+1
-0
No files found.
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionAlarm.py
View file @
75a80515
...
...
@@ -26,7 +26,7 @@ class TestSlapOSSubscriptionRequestProcessDraft(SlapOSTestCaseMixin):
title
=
"Test Subscription Request %s"
%
self
.
new_id
,
reference
=
"TESTSUBSCRIPTIONREQUEST-%s"
%
self
.
new_id
)
subscription_request
.
plan
ned
()
subscription_request
.
plan
()
self
.
_test_alarm
(
alarm
,
subscription_request
,
script_name
)
...
...
@@ -40,8 +40,8 @@ class TestSlapOSSubscriptionRequestProcessDraft(SlapOSTestCaseMixin):
title
=
"Test Subscription Request %s"
%
self
.
new_id
,
reference
=
"TESTSUBSCRIPTIONREQUEST-%s"
%
self
.
new_id
)
subscription_request
.
plan
ned
()
subscription_request
.
order
ed
()
subscription_request
.
plan
()
subscription_request
.
order
()
self
.
_test_alarm
(
alarm
,
subscription_request
,
script_name
)
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSTrialSkins.py
View file @
75a80515
...
...
@@ -3,6 +3,7 @@ from erp5.component.test.SlapOSTestCaseMixin import \
SlapOSTestCaseMixinWithAbort
,
simulate
from
zExceptions
import
Unauthorized
from
DateTime
import
DateTime
import
json
class
TestTrialSkinsMixin
(
SlapOSTestCaseMixinWithAbort
):
...
...
@@ -50,6 +51,15 @@ class TestTrialSkinsMixin(SlapOSTestCaseMixinWithAbort):
self
.
tic
()
return
trial_condition
def
cleanupAllTestTrialCondition
(
self
):
self
.
portal
.
trial_condition_module
.
manage_delObjects
(
ids
=
[
i
.
getId
()
for
i
in
self
.
portal
.
portal_catalog
(
portal_type
=
'Trial Condition'
,
title
=
"Test Trial Condition %"
,
reference
=
"TESTTRIALCONDITION-%"
)
])
self
.
tic
()
def
newTrialRequest
(
self
,
title
=
None
,
index
=
1
,
**
kw
):
if
title
is
None
:
title
=
title
=
"Test Trial Request %s"
%
self
.
new_id
...
...
@@ -542,3 +552,50 @@ if "token" not in mapping_dict:
self
.
assertEqual
(
"destroy_requested"
,
hosting_subscription
.
getSlapState
(),
hosting_subscription
.
getRelativeUrl
())
self
.
assertEqual
(
"destroy_requested"
,
instance
.
getSlapState
())
class
TestERP5Site_getTrialConfigurationAsJSON
(
TestTrialSkinsMixin
):
def
test_simple_ERP5Site_getTrialConfigurationAsJSON
(
self
):
self
.
cleanupAllTestTrialCondition
()
trial_condition
=
self
.
newTrialCondition
()
trial_condition
.
edit
(
title
=
"Test Trial Condition TEST"
,
text_content
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
<parameter id="abc">%(input)s</parameter>
</instance>"""
,
source_reference
=
"default"
,
url_string
=
"http://lab.nexedi.com/nexedi/couscous"
,
root_slave
=
False
,
subject_list
=
[
"input"
],
sla_xml
=
"""<?xml version="1.0" encoding="utf-8"?>
<instance>
</instance>"""
)
self
.
tic
()
expected_json
=
json
.
dumps
([])
self
.
assertEqual
(
expected_json
,
self
.
portal
.
ERP5Site_getTrialConfigurationAsJSON
())
trial_condition
.
validate
()
self
.
tic
()
self
.
assertEqual
(
expected_json
,
self
.
portal
.
ERP5Site_getTrialConfigurationAsJSON
())
trial_condition
.
publish
()
self
.
tic
()
expected_dict
=
{
"name"
:
trial_condition
.
getTitle
(),
"footer"
:
""
,
"url"
:
trial_condition
.
getRelativeUrl
(),
"price"
:
"1 Month Free Trial"
,
"product_description"
:
""
,
"header"
:
""
,
"input_list"
:
[],
"terms_of_service"
:
""
}
found_list
=
json
.
loads
(
self
.
portal
.
ERP5Site_getTrialConfigurationAsJSON
())
self
.
assertEqual
(
1
,
len
(
found_list
))
found_dict
=
found_list
[
0
]
for
key
in
expected_dict
:
self
.
assertEqual
(
expected_dict
[
key
],
found_dict
[
key
])
master/tests/__init__.py
View file @
75a80515
...
...
@@ -8,6 +8,7 @@ slapos_bt_list = [
'erp5_web_shadir'
,
'slapos_accounting'
,
'slapos_cache'
,
'slapos_subscription_request'
,
'slapos_cloud'
,
'slapos_erp5'
,
'slapos_pdm'
,
...
...
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