-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
958 additions
and
205 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
489 changes: 489 additions & 0 deletions
489
migrations/versions/b984311d26d7_add_modified_by_created_by_fields_for_.py
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 |
---|---|---|
|
@@ -29,7 +29,7 @@ def test_superuser_can_register_not_triggering_password_reset(superuser, testapp | |
# Fills out the form | ||
form = res.forms['registerUserForm'] | ||
form['username'] = '[email protected]' | ||
form['full_name'] = 'Mr End2End' | ||
form['full_name'] = 'End2End' | ||
form['send_password_reset_email'].checked = False | ||
# Submits | ||
res = form.submit().follow() | ||
|
@@ -38,6 +38,9 @@ def test_superuser_can_register_not_triggering_password_reset(superuser, testapp | |
new_user = User.get_by_email('[email protected]') | ||
assert isinstance(new_user, User) | ||
assert new_user.is_active is False | ||
# Keeping track of who created what | ||
assert new_user.created_by == superuser | ||
assert new_user.modified_by == superuser | ||
# A password reset was not created | ||
password_reset = PasswordReset.query.filter_by(user=new_user).first() | ||
assert password_reset is None | ||
|
@@ -61,7 +64,7 @@ def test_superuser_can_register_with_password_reset(superuser, testapp): | |
# Fills out the form | ||
form = res.forms['registerUserForm'] | ||
form['username'] = '[email protected]' | ||
form['full_name'] = 'Mr End2End' | ||
form['full_name'] = 'End2End' | ||
form['send_password_reset_email'].checked = True | ||
# Submits | ||
res = form.submit().follow() | ||
|
@@ -70,6 +73,8 @@ def test_superuser_can_register_with_password_reset(superuser, testapp): | |
new_user = User.get_by_email('[email protected]') | ||
assert isinstance(new_user, User) | ||
assert new_user.is_active is False | ||
assert new_user.created_by == superuser | ||
assert new_user.modified_by == superuser | ||
# A password reset was created | ||
password_resets = PasswordReset.query.filter_by(user=new_user).all() | ||
assert len(password_resets) == 1 | ||
|
@@ -115,7 +120,7 @@ def test_user_sees_error_message_if_user_already_registered(superuser, user, tes | |
# Fills out form, but username is already registered. | ||
form = res.forms['registerUserForm'] | ||
form['username'] = user.email.upper() # Default would be `[email protected]`, not upper-cased. | ||
form['full_name'] = 'Mr End2End' | ||
form['full_name'] = 'End2End' | ||
# Submits. | ||
res = form.submit() | ||
# Sees error. | ||
|
Oops, something went wrong.