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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
e26cc4bb
Commit
e26cc4bb
authored
Jun 12, 2014
by
Jérome Perrin
Committed by
Gabriel Monnerat
Aug 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LiveTest: use independant requests for each test method
parent
3f7c060d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
+25
-10
No files found.
product/ERP5Type/tests/ERP5TypeLiveTestCase.py
View file @
e26cc4bb
...
...
@@ -31,12 +31,12 @@ import os
import
sys
import
imp
import
re
import
thread
from
Testing
import
ZopeTestCase
from
Testing.ZopeTestCase
import
PortalTestCase
,
user_name
from
Products.CMFCore.utils
import
getToolByName
from
Products.ERP5Type.tests.ProcessingNodeTestCase
import
ProcessingNodeTestCase
from
Products.ERP5Type.Globals
import
get_request
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
\
ERP5TypeTestCaseMixin
,
ERP5TypeTestCase
from
glob
import
glob
...
...
@@ -65,6 +65,7 @@ class ERP5TypeLiveTestCase(ERP5TypeTestCaseMixin):
- An eplicit list of exceptions to live tests remains to be
defined.
"""
portal
=
None
def
getPortalName
(
self
):
""" Return the default ERP5 site id.
...
...
@@ -74,18 +75,32 @@ class ERP5TypeLiveTestCase(ERP5TypeTestCaseMixin):
def
getPortal
(
self
):
"""Returns the portal object, i.e. the "fixture root".
"""
if
self
.
portal
is
not
None
:
return
self
.
portal
from
Products.ERP5.ERP5Site
import
getSite
return
getSite
(
get_request
())
site
=
getSite
()
# reconstruct the acquistion chain with an independant request.
# RequestContainer -> Application -> Site
from
Testing.ZopeTestCase.utils
import
makerequest
portal
=
getattr
(
makerequest
(
site
.
aq_parent
),
site
.
getId
())
getPortalObject
=
getPortal
# Make the various get_request patches return this request.
# This is for ERP5TypeTestCase patch
from
Testing.ZopeTestCase.connections
import
registry
if
registry
:
registry
.
_conns
[
-
1
]
=
portal
# This is for Localizer patch
from
Products.Localizer
import
patches
request
=
portal
.
REQUEST
with
patches
.
_requests_lock
:
patches
.
_requests
[
thread
.
get_ident
()]
=
request
#def logout(self):
# PortalTestCase.logout(self)
# # clean up certain cache related REQUEST keys that might be associated
# # with the logged in user
# for key in ('_ec_cache', '_oai_cache'):
# pass
# #self.REQUEST.other.pop(key, None) # XXX
self
.
portal
=
portal
return
portal
getPortalObject
=
getPortal
def
createSimpleUser
(
self
,
title
,
reference
,
*
args
,
**
kwargs
):
"""
...
...
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