forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Make name/email lookups case-insensitive (ietf-tools#5972)
Use icontains so that looking up name or email is case insensitive Added a test Fixes: 5972
- Loading branch information
Showing
2 changed files
with
10 additions
and
2 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 |
---|---|---|
|
@@ -112,6 +112,14 @@ def test_person_profile_without_email(self): | |
r = self.client.get(url) | ||
self.assertContains(r, person.name, status_code=200) | ||
|
||
def test_case_insensitive(self): | ||
# Case insensitive seach | ||
person = PersonFactory(name="Test Person") | ||
url = urlreverse("ietf.person.views.profile", kwargs={ "email_or_name": "test person"}) | ||
r = self.client.get(url) | ||
self.assertContains(r, person.name, status_code=200) | ||
self.assertNotIn('More than one person', r.content.decode()) | ||
|
||
def test_person_profile_duplicates(self): | ||
# same Person name and email - should not show on the profile as multiple Person records | ||
person = PersonFactory(name="[email protected]", user__email="[email protected]") | ||
|
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