Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
460b31ab
Commit
460b31ab
authored
Apr 23, 2014
by
ziafazal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved security tests to lms also
parent
5ccd5cb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
lms/djangoapps/api_manager/tests/test_sessions_security.py
+8
-5
No files found.
common
/djangoapps/api_manager/tests/test_sessions_security.py
→
lms
/djangoapps/api_manager/tests/test_sessions_security.py
View file @
460b31ab
...
@@ -73,10 +73,11 @@ class SessionApiSecurityTest(TestCase):
...
@@ -73,10 +73,11 @@ class SessionApiSecurityTest(TestCase):
@override_settings
(
ENABLE_MAX_FAILED_LOGIN_ATTEMPTS
=
True
,
MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED
=
10
,
@override_settings
(
ENABLE_MAX_FAILED_LOGIN_ATTEMPTS
=
True
,
MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED
=
10
,
MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS
=
1800
)
MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS
=
1800
)
def
test_
login_
blockout_reset_time_period
(
self
):
def
test_blockout_reset_time_period
(
self
):
"""
"""
Try logging in 10 times to block user and then login with right credentials(after 30 minutes)
Try logging in 10 times to block user and then login with right
to verify blocked out time expired and user can login successfully.
credentials(after 30 minutes) to verify blocked out time expired and
user can login successfully.
"""
"""
for
i
in
xrange
(
10
):
for
i
in
xrange
(
10
):
password
=
u'test_password{0}'
.
format
(
i
)
password
=
u'test_password{0}'
.
format
(
i
)
...
@@ -118,7 +119,8 @@ class SessionApiSecurityTest(TestCase):
...
@@ -118,7 +119,8 @@ class SessionApiSecurityTest(TestCase):
PASSWORD_COMPLEXITY
=
{
'UPPER'
:
2
,
'LOWER'
:
2
,
'PUNCTUATION'
:
2
,
'DIGITS'
:
2
})
PASSWORD_COMPLEXITY
=
{
'UPPER'
:
2
,
'LOWER'
:
2
,
'PUNCTUATION'
:
2
,
'DIGITS'
:
2
})
def
test_password_without_uppercase
(
self
):
def
test_password_without_uppercase
(
self
):
"""
"""
Try (and fail) user creation since password should have atleast 2 upper characters
Try (and fail) user creation since password should have atleast
2 upper characters
"""
"""
response
=
self
.
_do_post_request
(
self
.
user_url
,
'test'
,
'test.pa64!'
,
email
=
'test@edx.org'
,
response
=
self
.
_do_post_request
(
self
.
user_url
,
'test'
,
'test.pa64!'
,
email
=
'test@edx.org'
,
first_name
=
'John'
,
last_name
=
'Doe'
,
secure
=
True
)
first_name
=
'John'
,
last_name
=
'Doe'
,
secure
=
True
)
...
@@ -129,7 +131,8 @@ class SessionApiSecurityTest(TestCase):
...
@@ -129,7 +131,8 @@ class SessionApiSecurityTest(TestCase):
PASSWORD_COMPLEXITY
=
{
'UPPER'
:
2
,
'LOWER'
:
2
,
'PUNCTUATION'
:
2
,
'DIGITS'
:
2
})
PASSWORD_COMPLEXITY
=
{
'UPPER'
:
2
,
'LOWER'
:
2
,
'PUNCTUATION'
:
2
,
'DIGITS'
:
2
})
def
test_password_without_lowercase
(
self
):
def
test_password_without_lowercase
(
self
):
"""
"""
Try (and fail) user creation without any numeric characters in password
Try (and fail) user creation without any numeric characters
in password
"""
"""
response
=
self
.
_do_post_request
(
self
.
user_url
,
'test'
,
'TEST.PA64!'
,
email
=
'test@edx.org'
,
response
=
self
.
_do_post_request
(
self
.
user_url
,
'test'
,
'TEST.PA64!'
,
email
=
'test@edx.org'
,
first_name
=
'John'
,
last_name
=
'Doe'
,
secure
=
True
)
first_name
=
'John'
,
last_name
=
'Doe'
,
secure
=
True
)
...
...
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