Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
b90e9db7
Commit
b90e9db7
authored
Jan 12, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check password in portal preferecne reset
parent
58e8e0ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
product/ERP5/tests/testAuthenticationPolicy.py
product/ERP5/tests/testAuthenticationPolicy.py
+12
-2
No files found.
product/ERP5/tests/testAuthenticationPolicy.py
View file @
b90e9db7
...
@@ -747,6 +747,7 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
...
@@ -747,6 +747,7 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
def
test_PreferenceTool_changePassword_checks_policy
(
self
):
def
test_PreferenceTool_changePassword_checks_policy
(
self
):
person
=
self
.
createUser
(
self
.
id
(),
password
=
'current'
)
person
=
self
.
createUser
(
self
.
id
(),
password
=
'current'
)
person
.
newContent
(
portal_type
=
'Assignment'
).
open
()
login
=
person
.
objectValues
(
portal_type
=
'ERP5 Login'
)[
0
]
login
=
person
.
objectValues
(
portal_type
=
'ERP5 Login'
)[
0
]
preference
=
self
.
portal
.
portal_catalog
.
getResultValue
(
preference
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'System Preference'
,
portal_type
=
'System Preference'
,
...
@@ -755,11 +756,10 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
...
@@ -755,11 +756,10 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
self
.
_clearCache
()
self
.
_clearCache
()
self
.
tic
()
self
.
tic
()
self
.
login
(
person
.
getUserId
())
# too short password is refused
# too short password is refused
ret
=
self
.
publish
(
ret
=
self
.
publish
(
'%s/portal_preferences'
%
self
.
portal
.
getPath
(),
'%s/portal_preferences'
%
self
.
portal
.
getPath
(),
basic
=
'%s:current'
%
self
.
id
(),
stdin
=
StringIO
(
urllib
.
urlencode
({
stdin
=
StringIO
(
urllib
.
urlencode
({
'Base_callDialogMethod:method'
:
''
,
'Base_callDialogMethod:method'
:
''
,
'dialog_id'
:
'PreferenceTool_viewChangePasswordDialog'
,
'dialog_id'
:
'PreferenceTool_viewChangePasswordDialog'
,
...
@@ -775,9 +775,19 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
...
@@ -775,9 +775,19 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
'<span class="error">Too short. </span>'
,
'<span class="error">Too short. </span>'
,
ret
.
getBody
())
ret
.
getBody
())
# if for some reason, PreferenceTool_setNewPassword is called directly,
# the password policy is also checked, so this cause an unhandled exception.
self
.
login
(
person
.
getId
())
self
.
assertRaises
(
ValueError
,
self
.
portal
.
PreferenceTool_setNewPassword
,
current_password
=
'current'
,
new_password
=
'short'
)
# long enough password is accepted
# long enough password is accepted
ret
=
self
.
publish
(
ret
=
self
.
publish
(
'%s/portal_preferences'
%
self
.
portal
.
getPath
(),
'%s/portal_preferences'
%
self
.
portal
.
getPath
(),
basic
=
'%s:current'
%
self
.
id
(),
stdin
=
StringIO
(
urllib
.
urlencode
({
stdin
=
StringIO
(
urllib
.
urlencode
({
'Base_callDialogMethod:method'
:
''
,
'Base_callDialogMethod:method'
:
''
,
'dialog_id'
:
'PreferenceTool_viewChangePasswordDialog'
,
'dialog_id'
:
'PreferenceTool_viewChangePasswordDialog'
,
...
...
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