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
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
Tomáš Peterka
erp5
Commits
9879579a
Commit
9879579a
authored
Sep 09, 2011
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add alarm test for expired events (authentication).
parent
b0ff42f9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
product/ERP5/tests/testAuthenticationPolicy.py
product/ERP5/tests/testAuthenticationPolicy.py
+36
-0
No files found.
product/ERP5/tests/testAuthenticationPolicy.py
View file @
9879579a
...
@@ -581,6 +581,42 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
...
@@ -581,6 +581,42 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
response
=
self
.
publish
(
path
)
response
=
self
.
publish
(
path
)
self
.
assertTrue
(
'Welcome to ERP5'
in
response
.
getBody
())
self
.
assertTrue
(
'Welcome to ERP5'
in
response
.
getBody
())
def
test_06_ExpireOldAuthenticationEventList
(
self
):
"""
Check that expiring old Authentication Event list works.
"""
portal
=
self
.
getPortal
()
person
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Person'
,
reference
=
'test'
)
preference
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'System Preference'
,
title
=
'Authentication'
,)
# file some failures so we should detect and block account
person
.
notifyLoginFailure
()
person
.
notifyLoginFailure
()
person
.
notifyLoginFailure
()
self
.
stepTic
()
# should be blocked
self
.
assertTrue
(
person
.
isLoginBlocked
())
# set 0 check interval
preference
.
setPreferredAuthenticationFailureCheckDuration
(
0
)
self
.
stepTic
()
self
.
_clearCache
()
time
.
sleep
(
1
)
# we need to give a moment
self
.
assertFalse
(
person
.
isLoginBlocked
())
# expire manually old
portal
.
system_event_module
.
SystemEventModule_expireAuthenticationEventList
()
self
.
stepTic
()
self
.
assertEqual
(
3
,
len
(
portal
.
portal_catalog
(
portal_type
=
"Authentication Event"
,
default_destination_uid
=
person
.
getUid
(),
validation_state
=
"expired"
)))
def
test_suite
():
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestAuthenticationPolicy
))
suite
.
addTest
(
unittest
.
makeSuite
(
TestAuthenticationPolicy
))
...
...
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