-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added the backend feature of pwned passwords
- Loading branch information
1 parent
234b51f
commit ffe6e1d
Showing
9 changed files
with
93 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,7 @@ def generate_independent_student_details(): | |
name = "Independent Student %d" % generate_independent_student_details.next_id | ||
email_address = "student%[email protected]" % generate_independent_student_details.next_id | ||
username = email_address | ||
password = "Password2" | ||
password = "$RFVBGT%^YHNmju7" | ||
|
||
generate_independent_student_details.next_id += 1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,22 @@ def test_signup_common_password_fails(self): | |
# Assert response isn't a redirect (submit failure) | ||
assert response.status_code == 200 | ||
|
||
response = c.post( | ||
reverse("register"), | ||
{ | ||
"independent_student_signup-date_of_birth_day": 7, | ||
"independent_student_signup-date_of_birth_month": 10, | ||
"independent_student_signup-date_of_birth_year": 1997, | ||
"independent_student_signup-name": "Test Name", | ||
"independent_student_signup-email": "[email protected]", | ||
"independent_student_signup-consent_ticked": "on", | ||
"independent_student_signup-password": "Password123$", | ||
"independent_student_signup-confirm_password": "Password123$", | ||
"g-recaptcha-response": "something", | ||
}, | ||
) | ||
assert response.status_code == 200 | ||
|
||
def test_signup_passwords_do_not_match_fails(self): | ||
c = Client() | ||
|
||
|
@@ -110,8 +126,8 @@ def test_signup_invalid_name_fails(self): | |
"independent_student_signup-name": "///", | ||
"independent_student_signup-email": "[email protected]", | ||
"independent_student_signup-consent_ticked": "on", | ||
"independent_student_signup-password": "Password1!", | ||
"independent_student_signup-confirm_password": "Password1!", | ||
"independent_student_signup-password": "$RRFVBGT%6yhnmju7", | ||
"independent_student_signup-confirm_password": "$RRFVBGT%6yhnmju7", | ||
"g-recaptcha-response": "something", | ||
}, | ||
) | ||
|
@@ -131,8 +147,8 @@ def test_signup_under_13_sends_parent_email(self): | |
"independent_student_signup-name": "Young person", | ||
"independent_student_signup-email": "[email protected]", | ||
"independent_student_signup-consent_ticked": "on", | ||
"independent_student_signup-password": "Password1!", | ||
"independent_student_signup-confirm_password": "Password1!", | ||
"independent_student_signup-password": "$RRFVBGT%6yhnmju7", | ||
"independent_student_signup-confirm_password": "$RRFVBGT%6yhnmju7", | ||
"g-recaptcha-response": "something", | ||
}, | ||
) | ||
|
@@ -215,8 +231,9 @@ def test_signup_duplicate_email_with_teacher(self): | |
page = self.go_to_homepage() | ||
page = page.go_to_signup_page() | ||
|
||
strong_password = "£EDCVFR$5tgbnhy6" | ||
page = page.independent_student_signup( | ||
"indy", teacher_email, password="Password1!", confirm_password="Password1!" | ||
"indy", teacher_email, password=strong_password, confirm_password=strong_password | ||
) | ||
|
||
page.return_to_home_page() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ def test_invite_teacher_successful(self): | |
invited_teacher_first_name = "Valid" | ||
invited_teacher_last_name = "Name" | ||
invited_teacher_email = "[email protected]" | ||
invited_teacher_password = "Password1!" | ||
invited_teacher_password = "$RRFVBGT%^yhnmju7" | ||
|
||
# Invite another teacher to school and check they got an email | ||
dashboard_url = reverse("dashboard") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,6 +308,22 @@ def test_signup_common_password_fails(self): | |
# Assert response isn't a redirect (submit failure) | ||
assert response.status_code == 200 | ||
|
||
response = c.post( | ||
reverse("register"), | ||
{ | ||
"independent_student_signup-date_of_birth_day": 7, | ||
"independent_student_signup-date_of_birth_month": 10, | ||
"independent_student_signup-date_of_birth_year": 1997, | ||
"independent_student_signup-name": "Test Name", | ||
"independent_student_signup-email": "[email protected]", | ||
"independent_student_signup-consent_ticked": "on", | ||
"independent_student_signup-password": "Password123$", | ||
"independent_student_signup-confirm_password": "Password123$", | ||
"g-recaptcha-response": "something", | ||
}, | ||
) | ||
assert response.status_code == 200 | ||
|
||
def test_signup_passwords_do_not_match_fails(self): | ||
c = Client() | ||
|
||
|
@@ -483,7 +499,7 @@ def test_edit_details(self): | |
page = HomePage(self.selenium).go_to_teacher_login_page().login(email, password).open_account_tab() | ||
|
||
page = page.change_teacher_details( | ||
{"first_name": "Paulina", "last_name": "Koch", "current_password": "Password2!"} | ||
{"first_name": "Paulina", "last_name": "Koch", "current_password": "$RFVBGT%6yhn"} | ||
) | ||
assert self.is_dashboard_page(page) | ||
assert is_teacher_details_updated_message_showing(self.selenium) | ||
|
@@ -503,8 +519,9 @@ def test_edit_details_non_admin(self): | |
self.selenium.get(self.live_server_url) | ||
page = HomePage(self.selenium).go_to_teacher_login_page().login(email_2, password_2).open_account_tab() | ||
|
||
strong_password = "$RFV`bgt%6yhn" | ||
page = page.change_teacher_details( | ||
{"first_name": "Florian", "last_name": "Aucomte", "current_password": "Password2!"} | ||
{"first_name": "Florian", "last_name": "Aucomte", "current_password": password_2} | ||
) | ||
assert self.is_dashboard_page(page) | ||
assert is_teacher_details_updated_message_showing(self.selenium) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters