-
Notifications
You must be signed in to change notification settings - Fork 150
Change lookup value to dynamic value #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
martirella
wants to merge
2
commits into
anexia-it:master
Choose a base branch
from
martirella:generic-lookup-field
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -72,7 +72,7 @@ def test_validate_bad_token(self): | |
# try to validate an invalid token | ||
response = self.rest_do_validate_token("not_a_valid_token") | ||
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) | ||
|
||
# there should be zero tokens | ||
self.assertEqual(ResetPasswordToken.objects.all().count(), 0) | ||
|
||
|
@@ -173,7 +173,7 @@ def test_reset_password_different_lookup(self, mock_reset_password_token_created | |
# there should be zero tokens | ||
self.assertEqual(ResetPasswordToken.objects.all().count(), 0) | ||
|
||
response = self.rest_do_request_reset_token(email="[email protected]") | ||
response = self.rest_do_request_reset_token(username="[email protected]") | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
# check that the signal was sent once | ||
self.assertTrue(mock_reset_password_token_created.called) | ||
|
@@ -185,7 +185,7 @@ def test_reset_password_different_lookup(self, mock_reset_password_token_created | |
self.assertEqual(ResetPasswordToken.objects.all().count(), 1) | ||
|
||
# if the same user tries to reset again, the user will get the same token again | ||
response = self.rest_do_request_reset_token(email="[email protected]") | ||
response = self.rest_do_request_reset_token(username="[email protected]") | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertEqual(mock_reset_password_token_created.call_count, 2) | ||
last_reset_password_token = mock_reset_password_token_created.call_args[1]['reset_password_token'] | ||
|
@@ -315,10 +315,10 @@ def test_signals(self, | |
|
||
@override_settings(DJANGO_REST_PASSWORDRESET_NO_INFORMATION_LEAKAGE=True) | ||
def test_try_reset_password_email_does_not_exist_no_leakage_enabled(self): | ||
""" | ||
""" | ||
Tests requesting a token for an email that does not exist when | ||
DJANGO_REST_PASSWORDRESET_NO_INFORMATION_LEAKAGE == True | ||
""" | ||
""" | ||
response = self.rest_do_request_reset_token(email="[email protected]") | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
def test_user_without_password(self): | ||
|
@@ -372,4 +372,3 @@ def test_user_without_password_where_not_required(self, mock_reset_password_toke | |
self.django_check_login("user4", "new_secret"), | ||
msg="User 4 should be able to login with the modified credentials" | ||
) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The heading is no longer correct when the lookup-field can be anything, not only email.
'custom_email_field' should be changed to a more generic value too, to make clear that the lookup-field is not limited to an email-adress