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
3a0274a8
Commit
3a0274a8
authored
Jun 21, 2001
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarified expected behavior of tests.
parent
9eabf756
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
lib/python/AccessControl/tests/testSecurity.py
lib/python/AccessControl/tests/testSecurity.py
+9
-8
No files found.
lib/python/AccessControl/tests/testSecurity.py
View file @
3a0274a8
...
@@ -85,8 +85,8 @@
...
@@ -85,8 +85,8 @@
"""Document Template Tests
"""Document Template Tests
"""
"""
__rcs_id__
=
'$Id: testSecurity.py,v 1.
2 2001/04/27 20:27:38
shane Exp $'
__rcs_id__
=
'$Id: testSecurity.py,v 1.
3 2001/06/21 17:21:09
shane Exp $'
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
import
sys
,
os
import
sys
,
os
import
unittest
import
unittest
...
@@ -117,10 +117,11 @@ class SecurityTests (DTMLTests):
...
@@ -117,10 +117,11 @@ class SecurityTests (DTMLTests):
class
person
:
class
person
:
name
=
'Jim'
name
=
'Jim'
doc
=
self
.
doc_class
(
'<dtml-with person>Hi, my name is '
'<dtml-var name></dtml-with>'
)
try
:
try
:
res
=
self
.
doc_class
(
doc
(
person
=
person
)
'<dtml-with person>Hi, my name is '
'<dtml-var name></dtml-with>'
)(
person
=
person
)
except
Unauthorized
:
except
Unauthorized
:
# Passed the test.
# Passed the test.
pass
pass
...
@@ -136,7 +137,7 @@ class SecurityTests (DTMLTests):
...
@@ -136,7 +137,7 @@ class SecurityTests (DTMLTests):
html
=
self
.
doc_class
(
'<dtml-var expr="myinst.somemethod()">'
)
html
=
self
.
doc_class
(
'<dtml-var expr="myinst.somemethod()">'
)
try
:
try
:
res
=
html
(
myinst
=
myclass
())
html
(
myinst
=
myclass
())
except
Unauthorized
:
except
Unauthorized
:
# Passed the test.
# Passed the test.
pass
pass
...
@@ -151,8 +152,8 @@ class SecurityTests (DTMLTests):
...
@@ -151,8 +152,8 @@ class SecurityTests (DTMLTests):
expr
=
'<dtml-var expr="(lambda x, _read=(lambda ob:ob): x.y)(c)">'
expr
=
'<dtml-var expr="(lambda x, _read=(lambda ob:ob): x.y)(c)">'
try
:
try
:
# This would be a security hole.
# This would be a security hole.
html
=
self
.
doc_class
(
expr
)
html
=
self
.
doc_class
(
expr
)
# It might compile here...
html
()
html
()
# or it might compile here.
except
SyntaxError
:
except
SyntaxError
:
# Passed the test.
# Passed the test.
pass
pass
...
...
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