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
1f07e0c1
Commit
1f07e0c1
authored
Oct 21, 2005
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forward-port tests for collector #1926 from 2.8 branch.
parent
602168f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
lib/python/AccessControl/tests/testUserFolder.py
lib/python/AccessControl/tests/testUserFolder.py
+32
-0
No files found.
lib/python/AccessControl/tests/testUserFolder.py
View file @
1f07e0c1
...
...
@@ -206,6 +206,38 @@ class UserFolderTests(unittest.TestCase):
except
OverflowError
:
assert
0
,
"Raised overflow error erroneously"
def
test__doAddUser_with_not_yet_encrypted_passwords
(
self
):
# See collector #1869 && #1926
from
AccessControl.AuthEncoding
import
pw_validate
USER_ID
=
'not_yet_encrypted'
PASSWORD
=
'password'
uf
=
UserFolder
().
__of__
(
self
.
app
)
uf
.
encrypt_passwords
=
True
self
.
failIf
(
uf
.
_isPasswordEncrypted
(
PASSWORD
))
uf
.
_doAddUser
(
USER_ID
,
PASSWORD
,
[],
[])
user
=
uf
.
getUserById
(
USER_ID
)
self
.
failUnless
(
uf
.
_isPasswordEncrypted
(
user
.
__
))
self
.
failUnless
(
pw_validate
(
user
.
__
,
PASSWORD
))
def
test__doAddUser_with_preencrypted_passwords
(
self
):
# See collector #1869 && #1926
from
AccessControl.AuthEncoding
import
pw_validate
USER_ID
=
'already_encrypted'
PASSWORD
=
'password'
uf
=
UserFolder
().
__of__
(
self
.
app
)
uf
.
encrypt_passwords
=
True
ENCRYPTED
=
uf
.
_encryptPassword
(
PASSWORD
)
uf
.
_doAddUser
(
USER_ID
,
ENCRYPTED
,
[],
[])
user
=
uf
.
getUserById
(
USER_ID
)
self
.
assertEqual
(
user
.
__
,
ENCRYPTED
)
self
.
failUnless
(
uf
.
_isPasswordEncrypted
(
user
.
__
))
self
.
failUnless
(
pw_validate
(
user
.
__
,
PASSWORD
))
class
UserTests
(
unittest
.
TestCase
):
...
...
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