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
d4b4c161
Commit
d4b4c161
authored
Jul 29, 2007
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve and document test
parent
22d8c250
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
lib/python/ZPublisher/tests/testBaseRequest.py
lib/python/ZPublisher/tests/testBaseRequest.py
+14
-4
No files found.
lib/python/ZPublisher/tests/testBaseRequest.py
View file @
d4b4c161
...
...
@@ -441,19 +441,29 @@ class TestBaseRequestZope3Views(TestCase):
self
.
assertEqual
(
r
[
'URL'
],
'/folder/obj/++view++meth'
)
def
test_browserDefault
(
self
):
# Test that browserDefault returning self, () works
# browserDefault can return self, () to indicate that the
# object itself wants to be published (using __call__):
r
=
self
.
makeBaseRequest
()
ob
=
r
.
traverse
(
'folder/obj/page'
)
self
.
assertEqual
(
ob
(),
'Test page'
)
# browserDefault can return another_object, () to indicate
# that that object should be published (using __call__):
r
=
self
.
makeBaseRequest
()
ob
=
r
.
traverse
(
'folder/obj/page2'
)
self
.
assertEqual
(
ob
(),
'Test page'
)
# browserDefault can also return self.some_method, () to
# indicate that that method should be called.
r
=
self
.
makeBaseRequest
()
ob
=
r
.
traverse
(
'folder/obj/page3'
)
self
.
assertEqual
(
ob
(),
'Test page'
)
def
test_suite
():
return
TestSuite
(
(
makeSuite
(
TestBaseRequest
),
makeSuite
(
TestBaseRequestZope3Views
),
)
)
return
TestSuite
([
makeSuite
(
TestBaseRequest
),
makeSuite
(
TestBaseRequestZope3Views
),
])
if
__name__
==
'__main__'
:
main
(
defaultTest
=
'test_suite'
)
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