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
Carlos Ramos Carreño
slapos.core
Commits
ba80b6c0
Commit
ba80b6c0
authored
May 29, 2013
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup site for Unit Test via configurator (wip)
parent
749379a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
103 additions
and
64 deletions
+103
-64
master/product/SlapOS/tests/testSlapOSMixin.py
master/product/SlapOS/tests/testSlapOSMixin.py
+103
-64
No files found.
master/product/SlapOS/tests/testSlapOSMixin.py
View file @
ba80b6c0
...
@@ -47,16 +47,87 @@ def withAbort(func):
...
@@ -47,16 +47,87 @@ def withAbort(func):
transaction
.
abort
()
transaction
.
abort
()
return
wrapped
return
wrapped
BUSINESS_TEMPLATE_LIST
=
[
'erp5_promise'
,
'erp5_upgrader'
,
'slapos_upgrader'
,
'erp5_full_text_myisam_catalog'
,
'erp5_core_proxy_field_legacy'
,
'erp5_base'
,
'erp5_administration'
,
'erp5_workflow'
,
'erp5_configurator'
,
'slapos_configurator'
,
'erp5_simulation'
,
'erp5_pdm'
,
'erp5_trade'
,
'erp5_tiosafe_core'
,
'erp5_item'
,
'erp5_forge'
,
'erp5_ingestion_mysql_innodb_catalog'
,
'erp5_ingestion'
,
'erp5_crm'
,
'erp5_system_event'
,
'erp5_secure_payment'
,
'erp5_payzen_secure_payment'
,
'erp5_ooo_import'
,
'erp5_odt_style'
,
'erp5_ods_style'
,
'erp5_jquery'
,
'erp5_jquery_ui'
,
'erp5_dhtml_style'
,
'erp5_knowledge_pad'
,
'erp5_web'
,
'erp5_rss_style'
,
'erp5_dms'
,
'erp5_content_translation'
,
'erp5_software_pdm'
,
'erp5_computer_immobilisation'
,
'erp5_open_trade'
,
'erp5_accounting'
,
'erp5_commerce'
,
'erp5_xhtml_jquery_style'
,
'erp5_credential'
,
'erp5_km'
,
'erp5_web_download_theme'
,
'erp5_web_shacache'
,
'erp5_data_set'
,
'erp5_web_shadir'
,
'erp5_accounting'
,
'erp5_invoicing'
,
'erp5_simplified_invoicing'
,
'erp5_credential_oauth2'
,
'erp5_accounting_l10n_fr'
,
'erp5_bearer_token'
,
'erp5_access_token'
,
'erp5_project'
,
'slapos_cache'
,
'slapos_cloud'
,
'slapos_slap_tool'
,
'slapos_category'
,
'slapos_rest_api_tool_portal_type'
,
'slapos_rest_api'
,
'slapos_hypermedia'
,
'slapos_pdm'
,
'slapos_crm'
,
'slapos_accounting'
,
'slapos_payzen'
,
'slapos_web'
,
'slapos_erp5'
,
]
class
testSlapOSMixin
(
ERP5TypeTestCase
):
class
testSlapOSMixin
(
ERP5TypeTestCase
):
def
clearCache
(
self
):
def
clearCache
(
self
):
self
.
portal
.
portal_caches
.
clearAllCache
()
self
.
portal
.
portal_caches
.
clearAllCache
()
self
.
portal
.
portal_workflow
.
refreshWorklistCache
()
self
.
portal
.
portal_workflow
.
refreshWorklistCache
()
def
getDefaultSitePreferenceId
(
self
):
#
def getDefaultSitePreferenceId(self):
"""Default id, usefull method to override
#
"""Default id, usefull method to override
"""
#
"""
return
"slapos_default_system_preference"
#
return "slapos_default_system_preference"
def
setUpMemcached
(
self
):
def
setUpMemcached
(
self
):
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
\
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
\
...
@@ -130,6 +201,14 @@ class testSlapOSMixin(ERP5TypeTestCase):
...
@@ -130,6 +201,14 @@ class testSlapOSMixin(ERP5TypeTestCase):
"""
"""
return
getattr
(
self
.
getPortal
(),
'acl_users'
,
None
)
return
getattr
(
self
.
getPortal
(),
'acl_users'
,
None
)
def
setUpOnce
(
self
):
# Reload promise and include yet another bt5 path.
self
.
loadPromise
(
searchable_business_template_list
=
[
"erp5_core"
,
"erp5_base"
,
"slapos_configurator"
])
self
.
portal
.
portal_alarms
.
promise_template_tool_configuration
.
solve
()
import
pdb
;
pdb
.
set_trace
()
transaction
.
commit
()
self
.
launchConfigurator
()
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
self
.
login
()
self
.
login
()
self
.
createAlarmStep
()
self
.
createAlarmStep
()
...
@@ -162,16 +241,32 @@ class testSlapOSMixin(ERP5TypeTestCase):
...
@@ -162,16 +241,32 @@ class testSlapOSMixin(ERP5TypeTestCase):
self
.
portal
.
email_from_address
=
'romain@nexedi.com'
self
.
portal
.
email_from_address
=
'romain@nexedi.com'
self
.
portal
.
email_to_address
=
'romain@nexedi.com'
self
.
portal
.
email_to_address
=
'romain@nexedi.com'
def
launchConfigurator
(
self
):
self
.
login
()
# Create new Configuration
business_configuration
=
self
.
portal
.
business_configuration_module
.
\
newContent
(
portal_type
=
"Business Configuration"
,
id
=
"test_slapos_master_configuration_workflow"
)
business_configuration
.
setResource
(
"workflow_module/slapos_master_configuration_workflow"
)
transaction
.
commit
()
response_dict
=
{}
while
response_dict
.
get
(
"command"
,
"next"
)
!=
"install"
:
response_dict
=
self
.
portal
.
portal_configurator
.
_next
(
business_configuration
,
{})
transaction
.
commit
()
self
.
tic
()
self
.
portal
.
portal_configurator
.
startInstallation
(
business_configuration
,
REQUEST
=
self
.
portal
.
REQUEST
)
def
bootstrapSite
(
self
):
def
bootstrapSite
(
self
):
self
.
setupPortalAlarms
()
self
.
setupPortalAlarms
()
self
.
setupPortalCertificateAuthority
()
self
.
setupPortalCertificateAuthority
()
self
.
setUpMemcached
()
self
.
setUpMemcached
()
self
.
clearCache
()
self
.
clearCache
()
# Invoke Post-configurator script, this invokes all
# alarms related to configuration.
self
.
portal
.
BusinessConfiguration_invokeSlapOSMasterPromiseAlarmList
()
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
...
@@ -190,62 +285,6 @@ class testSlapOSMixin(ERP5TypeTestCase):
...
@@ -190,62 +285,6 @@ class testSlapOSMixin(ERP5TypeTestCase):
'erp5_workflow'
,
'erp5_workflow'
,
'erp5_configurator'
,
'erp5_configurator'
,
'slapos_configurator'
,
'slapos_configurator'
,
'erp5_simulation'
,
'erp5_pdm'
,
'erp5_trade'
,
'erp5_tiosafe_core'
,
'erp5_item'
,
'erp5_forge'
,
'erp5_ingestion_mysql_innodb_catalog'
,
'erp5_ingestion'
,
'erp5_crm'
,
'erp5_system_event'
,
'erp5_secure_payment'
,
'erp5_payzen_secure_payment'
,
'erp5_ooo_import'
,
'erp5_odt_style'
,
'erp5_ods_style'
,
'erp5_jquery'
,
'erp5_jquery_ui'
,
'erp5_dhtml_style'
,
'erp5_knowledge_pad'
,
'erp5_web'
,
'erp5_rss_style'
,
'erp5_dms'
,
'erp5_content_translation'
,
'erp5_software_pdm'
,
'erp5_computer_immobilisation'
,
'erp5_open_trade'
,
'erp5_accounting'
,
'erp5_commerce'
,
'erp5_xhtml_jquery_style'
,
'erp5_credential'
,
'erp5_km'
,
'erp5_web_download_theme'
,
'erp5_web_shacache'
,
'erp5_data_set'
,
'erp5_web_shadir'
,
'erp5_accounting'
,
'erp5_invoicing'
,
'erp5_simplified_invoicing'
,
'erp5_credential_oauth2'
,
'erp5_accounting_l10n_fr'
,
'erp5_bearer_token'
,
'erp5_access_token'
,
'erp5_project'
,
'slapos_cache'
,
'slapos_cloud'
,
'slapos_slap_tool'
,
'slapos_category'
,
'slapos_rest_api_tool_portal_type'
,
'slapos_rest_api'
,
'slapos_hypermedia'
,
'slapos_pdm'
,
'slapos_crm'
,
'slapos_accounting'
,
'slapos_payzen'
,
'slapos_web'
,
'slapos_erp5'
,
]
]
return
result
return
result
...
...
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