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
b9b7940a
Commit
b9b7940a
authored
Sep 11, 2014
by
Chris Dodge
Committed by
Jonathan Piacenti
Aug 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add unit test to verify password complexity scoring
parent
9829b13a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
lms/djangoapps/api_manager/users/test_user_password_reset.py
+56
-0
No files found.
lms/djangoapps/api_manager/users/test_user_password_reset.py
View file @
b9b7940a
...
...
@@ -393,6 +393,62 @@ class UserPasswordResetTest(TestCase):
self
.
_assert_response
(
response
,
status
=
201
)
@override_settings
(
MINIMUM_PASSWORD_COMPLEXITY_SCORE
=
5
,
PASSWORD_MIN_LENGTH
=
8
,
PASSWORD_MAX_LENGTH
=
None
,
PASSWORD_COMPLEXITY
=
{
'UPPER'
:
1
,
'LOWER'
:
1
,
'PUNCTUATION'
:
1
,
'DIGITS'
:
1
,
'UPPER_SCORE'
:
2
,
'LOWER_SCORE'
:
2
,
'PUNCTUATION_SCORE'
:
1
,
'DIGITS_SCORE'
:
1
})
def
test_password_complexity_score_less_than_password_complexity_levels_total_score2
(
self
):
"""Test to set (a different set of weightings) the minimum score of password complexity < all the complexity
level scores. Total score of the password complexity levels is 6 and minimum password
complexity score is 5
"""
# try a few successful combinations
password
=
"Testpassw0rd"
response
=
self
.
_do_post_request
(
self
.
user_url
,
'test'
,
password
,
email
=
'test@edx.org'
,
first_name
=
'John'
,
last_name
=
'Doe'
,
secure
=
True
)
self
.
_assert_response
(
response
,
status
=
201
)
password
=
"tESTPASSW0RD"
response
=
self
.
_do_post_request
(
self
.
user_url
,
'test2'
,
password
,
email
=
'test2@edx.org'
,
first_name
=
'John'
,
last_name
=
'Doe'
,
secure
=
True
)
self
.
_assert_response
(
response
,
status
=
201
)
password
=
"tESTPA$SWORD"
response
=
self
.
_do_post_request
(
self
.
user_url
,
'test3'
,
password
,
email
=
'test3@edx.org'
,
first_name
=
'John'
,
last_name
=
'Doe'
,
secure
=
True
)
self
.
_assert_response
(
response
,
status
=
201
)
# test failure cases
password
=
"testpassword"
response
=
self
.
_do_post_request
(
self
.
user_url
,
'test4'
,
password
,
email
=
'test4@edx.org'
,
first_name
=
'John'
,
last_name
=
'Doe'
,
secure
=
True
)
self
.
_assert_response
(
response
,
status
=
400
)
password
=
"t1234
%
^&*"
response
=
self
.
_do_post_request
(
self
.
user_url
,
'test5'
,
password
,
email
=
'test5@edx.org'
,
first_name
=
'John'
,
last_name
=
'Doe'
,
secure
=
True
)
self
.
_assert_response
(
response
,
status
=
400
)
password
=
"T1234
%
^&*"
response
=
self
.
_do_post_request
(
self
.
user_url
,
'test6'
,
password
,
email
=
'test6@edx.org'
,
first_name
=
'John'
,
last_name
=
'Doe'
,
secure
=
True
)
self
.
_assert_response
(
response
,
status
=
400
)
@override_settings
(
MINIMUM_PASSWORD_COMPLEXITY_SCORE
=
4
,
PASSWORD_MIN_LENGTH
=
8
,
PASSWORD_MAX_LENGTH
=
None
,
PASSWORD_COMPLEXITY
=
{
'UPPER'
:
2
,
'LOWER'
:
2
,
'PUNCTUATION'
:
2
,
'DIGITS'
:
2
,
...
...
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