-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Check both Person and Email records in profile view (#4703)
- Loading branch information
Showing
2 changed files
with
23 additions
and
9 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 |
---|---|---|
|
@@ -104,6 +104,23 @@ def test_person_profile(self): | |
r = self.client.get(photo_url) | ||
self.assertEqual(r.status_code, 200) | ||
|
||
def test_person_profile_without_email(self): | ||
person = PersonFactory(name="[email protected]") | ||
# delete Email record | ||
person.email().delete() | ||
url = urlreverse("ietf.person.views.profile", kwargs={ "email_or_name": person.plain_name()}) | ||
r = self.client.get(url) | ||
self.assertContains(r, person.name, status_code=200) | ||
|
||
def test_person_profile_404(self): | ||
urls = [ | ||
urlreverse("ietf.person.views.profile", kwargs={ "email_or_name": "[email protected]"}), | ||
urlreverse("ietf.person.views.profile", kwargs={ "email_or_name": "Nonexistent Person"}),] | ||
|
||
for url in urls: | ||
r = self.client.get(url) | ||
self.assertEqual(r.status_code, 404) | ||
|
||
def test_person_photo(self): | ||
person = PersonFactory(with_bio=True) | ||
|
||
|
@@ -403,8 +420,3 @@ def test_dots(self): | |
self.assertEqual(get_dots(ncmember),['nomcom']) | ||
ncchair = RoleFactory(group__acronym='nomcom2020',group__type_id='nomcom',name_id='chair').person | ||
self.assertEqual(get_dots(ncchair),['nomcom']) | ||
|
||
|
||
|
||
|
||
|
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