Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
cf4287cf
Commit
cf4287cf
authored
Apr 05, 2006
by
Paul Winkler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed duplicate code from ZopeTestCase.utils.makerequest;
it now wraps Testing.makerequest.makerequest().
parent
f1f1e9b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
15 deletions
+3
-15
lib/python/Testing/ZopeTestCase/utils.py
lib/python/Testing/ZopeTestCase/utils.py
+3
-15
No files found.
lib/python/Testing/ZopeTestCase/utils.py
View file @
cf4287cf
...
...
@@ -127,25 +127,13 @@ def startZServer(number_of_threads=1, log=None):
def
makerequest
(
app
,
stdout
=
sys
.
stdout
):
'''Wraps the app into a fresh REQUEST.'''
from
ZPublisher.BaseRequest
import
RequestContainer
from
ZPublisher.Request
import
Request
from
ZPublisher.Response
import
Response
response
=
Response
(
stdout
=
stdout
)
from
Testing.makerequest
import
makerequest
as
_makerequest
environ
=
{}
environ
[
'SERVER_NAME'
]
=
_Z2HOST
or
'nohost'
environ
[
'SERVER_PORT'
]
=
'%d'
%
(
_Z2PORT
or
80
)
environ
[
'REQUEST_METHOD'
]
=
'GET'
request
=
Request
(
sys
.
stdin
,
environ
,
response
)
request
.
_steps
=
[
'noobject'
]
# Fake a published object
request
[
'ACTUAL_URL'
]
=
request
.
get
(
'URL'
)
# Zope 2.7.4
# set Zope3-style default skin so that the request is usable for
# Zope3-style view look-ups
from
zope.app.publication.browser
import
setDefaultSkin
setDefaultSkin
(
request
)
return
app
.
__of__
(
RequestContainer
(
REQUEST
=
request
))
app
=
_makerequest
(
app
,
stdout
=
stdout
,
environ
=
environ
)
return
app
def
appcall
(
function
,
*
args
,
**
kw
):
'''Calls a function passing 'app' as first argument.'''
...
...
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