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
e1a9e318
Commit
e1a9e318
authored
Oct 04, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testSlapOSMixin: Dont custom DummyMailHost setup
Rely on standard ERP5 implementation is enough
parent
40429299
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
28 deletions
+3
-28
master/product/SlapOS/tests/testSlapOSMixin.py
master/product/SlapOS/tests/testSlapOSMixin.py
+3
-28
No files found.
master/product/SlapOS/tests/testSlapOSMixin.py
View file @
e1a9e318
...
...
@@ -30,7 +30,6 @@ import random
import
transaction
import
unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
DummyMailHost
from
Products.ERP5Type.Utils
import
convertToUpperCase
import
os
import
glob
...
...
@@ -131,19 +130,7 @@ class testSlapOSMixin(ERP5TypeTestCase):
# XXX - What is the better way to know if we are in live test mode ?
return
not
os
.
environ
.
has_key
(
'TEST_CA_PATH'
)
def
_setUpDummyMailHost
(
self
):
"""Do not play with NON persistent replacement of MailHost"""
if
not
self
.
isLiveTest
():
ERP5TypeTestCase
.
_setUpDummyMailHost
(
self
)
def
_restoreMailHost
(
self
):
"""Do not play with NON persistent replacement of MailHost"""
if
not
self
.
isLiveTest
():
ERP5TypeTestCase
.
_restoreMailHost
(
self
)
def
beforeTearDown
(
self
):
if
self
.
isLiveTest
():
self
.
deSetUpPersistentDummyMailHost
()
if
self
.
abort_transaction
:
transaction
.
abort
()
...
...
@@ -170,6 +157,9 @@ class testSlapOSMixin(ERP5TypeTestCase):
def
afterSetUp
(
self
):
self
.
login
()
self
.
createAlarmStep
()
self
.
portal
.
email_from_address
=
'romain@nexedi.com'
self
.
portal
.
email_to_address
=
'romain@nexedi.com'
if
getattr
(
self
.
portal
.
portal_caches
,
'erp5_site_global_id'
,
None
):
# we are not on live test so multiple tests can run in parallel
...
...
@@ -178,26 +168,11 @@ class testSlapOSMixin(ERP5TypeTestCase):
self
.
portal
.
portal_caches
.
_p_changed
=
1
if
self
.
isLiveTest
():
self
.
setUpPersistentDummyMailHost
()
return
self
.
createCertificateAuthorityFile
()
self
.
commit
()
self
.
updateInitSite
()
def
deSetUpPersistentDummyMailHost
(
self
):
if
'MailHost'
in
self
.
portal
.
objectIds
():
self
.
portal
.
manage_delObjects
([
'MailHost'
])
self
.
portal
.
manage_addProduct
[
'MailHost'
].
manage_addMailHost
(
'MailHost'
)
self
.
commit
()
def
setUpPersistentDummyMailHost
(
self
):
if
'MailHost'
in
self
.
portal
.
objectIds
():
self
.
portal
.
manage_delObjects
([
'MailHost'
])
self
.
portal
.
_setObject
(
'MailHost'
,
DummyMailHost
(
'MailHost'
))
self
.
portal
.
email_from_address
=
'romain@nexedi.com'
self
.
portal
.
email_to_address
=
'romain@nexedi.com'
def
getBusinessConfiguration
(
self
):
return
self
.
portal
.
business_configuration_module
[
\
"slapos_master_configuration_workflow"
]
...
...
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