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
5e0f612a
Commit
5e0f612a
authored
May 21, 2006
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make some tests run: provide default traversal adapter so that simple path
traversal works.
parent
48526ec0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
lib/python/Products/PageTemplates/tests/testDTMLTests.py
lib/python/Products/PageTemplates/tests/testDTMLTests.py
+10
-4
lib/python/Products/PageTemplates/tests/testHTMLTests.py
lib/python/Products/PageTemplates/tests/testHTMLTests.py
+7
-1
No files found.
lib/python/Products/PageTemplates/tests/testDTMLTests.py
View file @
5e0f612a
...
@@ -13,6 +13,8 @@
...
@@ -13,6 +13,8 @@
import
os
,
sys
,
unittest
import
os
,
sys
,
unittest
import
zope.component.testing
from
zope.traversing.adapters
import
DefaultTraversable
from
Products.PageTemplates.tests
import
util
from
Products.PageTemplates.tests
import
util
from
Products.PageTemplates.PageTemplate
import
PageTemplate
from
Products.PageTemplates.PageTemplate
import
PageTemplate
from
Acquisition
import
Implicit
from
Acquisition
import
Implicit
...
@@ -43,16 +45,20 @@ class UnitTestSecurityPolicy:
...
@@ -43,16 +45,20 @@ class UnitTestSecurityPolicy:
def
checkPermission
(
self
,
permission
,
object
,
context
)
:
def
checkPermission
(
self
,
permission
,
object
,
context
)
:
return
1
return
1
class
DTMLTests
(
unittest
.
TestCase
):
class
DTMLTests
(
zope
.
component
.
testing
.
PlacelessSetup
,
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
t
=
(
AqPageTemplate
())
super
(
DTMLTests
,
self
).
setUp
()
zope
.
component
.
provideAdapter
(
DefaultTraversable
,
(
None
,))
self
.
t
=
AqPageTemplate
()
self
.
policy
=
UnitTestSecurityPolicy
()
self
.
policy
=
UnitTestSecurityPolicy
()
self
.
oldPolicy
=
SecurityManager
.
setSecurityPolicy
(
self
.
policy
)
self
.
oldPolicy
=
SecurityManager
.
setSecurityPolicy
(
self
.
policy
)
noSecurityManager
()
# Use the new policy.
noSecurityManager
()
# Use the new policy.
def
tearDown
(
self
):
def
tearDown
(
self
):
SecurityManager
.
setSecurityPolicy
(
self
.
oldPolicy
)
super
(
DTMLTests
,
self
).
tearDown
()
SecurityManager
.
setSecurityPolicy
(
self
.
oldPolicy
)
noSecurityManager
()
# Reset to old policy.
noSecurityManager
()
# Reset to old policy.
def
check1
(
self
):
def
check1
(
self
):
...
...
lib/python/Products/PageTemplates/tests/testHTMLTests.py
View file @
5e0f612a
...
@@ -13,6 +13,8 @@
...
@@ -13,6 +13,8 @@
import
os
,
sys
,
unittest
import
os
,
sys
,
unittest
import
zope.component.testing
from
zope.traversing.adapters
import
DefaultTraversable
from
Products.PageTemplates.tests
import
util
from
Products.PageTemplates.tests
import
util
from
Products.PageTemplates.PageTemplate
import
PageTemplate
from
Products.PageTemplates.PageTemplate
import
PageTemplate
from
Products.PageTemplates.GlobalTranslationService
import
\
from
Products.PageTemplates.GlobalTranslationService
import
\
...
@@ -59,9 +61,12 @@ class UnitTestSecurityPolicy:
...
@@ -59,9 +61,12 @@ class UnitTestSecurityPolicy:
def
checkPermission
(
self
,
permission
,
object
,
context
)
:
def
checkPermission
(
self
,
permission
,
object
,
context
)
:
return
1
return
1
class
HTMLTests
(
unittest
.
TestCase
):
class
HTMLTests
(
zope
.
component
.
testing
.
PlacelessSetup
,
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
super
(
HTMLTests
,
self
).
setUp
()
zope
.
component
.
provideAdapter
(
DefaultTraversable
,
(
None
,))
self
.
folder
=
f
=
Folder
()
self
.
folder
=
f
=
Folder
()
f
.
laf
=
AqPageTemplate
()
f
.
laf
=
AqPageTemplate
()
f
.
t
=
AqPageTemplate
()
f
.
t
=
AqPageTemplate
()
...
@@ -70,6 +75,7 @@ class HTMLTests(unittest.TestCase):
...
@@ -70,6 +75,7 @@ class HTMLTests(unittest.TestCase):
noSecurityManager
()
# Use the new policy.
noSecurityManager
()
# Use the new policy.
def
tearDown
(
self
):
def
tearDown
(
self
):
super
(
HTMLTests
,
self
).
tearDown
()
SecurityManager
.
setSecurityPolicy
(
self
.
oldPolicy
)
SecurityManager
.
setSecurityPolicy
(
self
.
oldPolicy
)
noSecurityManager
()
# Reset to old policy.
noSecurityManager
()
# Reset to old policy.
...
...
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