Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Léo-Paul Géneau
erp5
Commits
d931c6f6
Commit
d931c6f6
authored
Jan 03, 2014
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unit test: Enable again calls to setUpOnce when for portal components tests
parent
e1ce3bed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+11
-10
product/ERP5Type/tests/runUnitTest.py
product/ERP5Type/tests/runUnitTest.py
+8
-2
No files found.
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
d931c6f6
...
@@ -731,6 +731,16 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
...
@@ -731,6 +731,16 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
return
sorted
([
str
(
message
.
getMessage
())
return
sorted
([
str
(
message
.
getMessage
())
for
message
in
obj
.
checkConsistency
()
])
for
message
in
obj
.
checkConsistency
()
])
def
_callSetUpOnce
(
self
):
setup_once
=
getattr
(
self
,
'setUpOnce'
,
None
)
if
setup_once
is
not
None
and
\
not
getattr
(
self
.
portal
,
'set_up_once_called'
,
0
):
self
.
portal
.
set_up_once_called
=
1
ZopeTestCase
.
_print
(
'Executing setUpOnce ... '
)
start
=
time
.
time
()
setup_once
()
ZopeTestCase
.
_print
(
'done (%.3fs)
\
n
'
%
(
time
.
time
()
-
start
))
class
ERP5TypeCommandLineTestCase
(
ERP5TypeTestCaseMixin
):
class
ERP5TypeCommandLineTestCase
(
ERP5TypeTestCaseMixin
):
def
getPortalName
(
self
):
def
getPortalName
(
self
):
...
@@ -1073,16 +1083,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
...
@@ -1073,16 +1083,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
'Assignor'
,
'Author'
,
'Auditor'
,
'Associate'
],
[])
'Assignor'
,
'Author'
,
'Auditor'
,
'Associate'
],
[])
user
=
uf
.
getUserById
(
'ERP5TypeTestCase'
).
__of__
(
uf
)
user
=
uf
.
getUserById
(
'ERP5TypeTestCase'
).
__of__
(
uf
)
setup_once
=
getattr
(
self
,
'setUpOnce'
,
None
)
self
.
_callSetUpOnce
()
if
setup_once
is
not
None
and
\
not
getattr
(
portal
,
'set_up_once_called'
,
0
):
portal
.
set_up_once_called
=
1
if
not
quiet
:
ZopeTestCase
.
_print
(
'Executing setUpOnce ... '
)
start
=
time
.
time
()
setup_once
()
if
not
quiet
:
ZopeTestCase
.
_print
(
'done (%.3fs)
\
n
'
%
(
time
.
time
()
-
start
))
# Enable reindexing
# Enable reindexing
# Do hot reindexing # Does not work
# Do hot reindexing # Does not work
...
...
product/ERP5Type/tests/runUnitTest.py
View file @
d931c6f6
...
@@ -304,10 +304,16 @@ class ERP5TypeTestLoader(unittest.TestLoader):
...
@@ -304,10 +304,16 @@ class ERP5TypeTestLoader(unittest.TestLoader):
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeLiveTestCase
import
ERP5TypeLiveTestCase
from
Products.ERP5Type.tests.ERP5TypeLiveTestCase
import
ERP5TypeLiveTestCase
class
ComponentTestCase
(
ERP5TypeLiveTestCase
):
def
setUp
(
self
):
super
(
ComponentTestCase
,
self
).
setUp
()
self
.
_callSetUpOnce
()
# Bootstrap has been done in loadTestsFromNames, so the test can now
# Bootstrap has been done in loadTestsFromNames, so the test can now
# be loaded like any Live Test on a real instance
# be loaded like any Live Test on a real instance
if
ERP5TypeLive
TestCase
not
in
ERP5TypeTestCase
.
__bases__
:
if
Component
TestCase
not
in
ERP5TypeTestCase
.
__bases__
:
ERP5TypeTestCase
.
__bases__
=
ERP5TypeLive
TestCase
,
ERP5TypeTestCase
.
__bases__
=
Component
TestCase
,
# TestLoader() does not perform any import so import the Module manually
# TestLoader() does not perform any import so import the Module manually
module
=
__import__
(
'erp5.component.test'
,
module
=
__import__
(
'erp5.component.test'
,
...
...
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