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
a45b9e05
Commit
a45b9e05
authored
Jan 30, 2004
by
Brian Lloyd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed wrong test in testUserFolder
parent
a69225a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
lib/python/AccessControl/tests/testUserFolder.py
lib/python/AccessControl/tests/testUserFolder.py
+11
-10
No files found.
lib/python/AccessControl/tests/testUserFolder.py
View file @
a45b9e05
...
...
@@ -13,8 +13,8 @@
"""User folder tests
"""
__rcs_id__
=
'$Id: testUserFolder.py,v 1.
8 2004/01/30 14:00:32 shh
Exp $'
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
__rcs_id__
=
'$Id: testUserFolder.py,v 1.
9 2004/01/30 16:58:45 Brian
Exp $'
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
import
os
,
sys
,
base64
,
unittest
...
...
@@ -29,11 +29,6 @@ from AccessControl.SecurityManagement import noSecurityManager
from
AccessControl.User
import
BasicUserFolder
from
AccessControl.User
import
User
# XXX: Uncomment to enforce C implementation
#from AccessControl.SecurityManager import setSecurityPolicy
#from AccessControl.cAccessControl import ZopeSecurityPolicy
#setSecurityPolicy(ZopeSecurityPolicy(True, True))
class
UserFolderTests
(
unittest
.
TestCase
):
...
...
@@ -140,9 +135,16 @@ class UserFolderTests(unittest.TestCase):
user
=
self
.
uf
.
validate
(
self
.
app
.
REQUEST
,
''
,
[
'role1'
])
self
.
assertEqual
(
user
,
None
)
def
testNotValidateWithoutRoles
(
self
):
def
testValidateWithoutRoles
(
self
):
# Note - calling uf.validate without specifying roles will cause
# the security machinery to determine the needed roles by looking
# at the object itself (or its container). I'm putting this note
# in to clarify because the original test expected failure but it
# really should have expected success, since the user and the
# object being checked both have the role 'role1', even though no
# roles are passed explicitly to the userfolder validate method.
user
=
self
.
uf
.
validate
(
self
.
app
.
REQUEST
,
self
.
basic
)
self
.
assertEqual
(
user
,
None
)
self
.
assertEqual
(
user
.
getUserName
(),
'user1'
)
def
testNotValidateWithEmptyRoles
(
self
):
user
=
self
.
uf
.
validate
(
self
.
app
.
REQUEST
,
self
.
basic
,
[])
...
...
@@ -240,4 +242,3 @@ def test_suite():
if
__name__
==
'__main__'
:
unittest
.
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