Skip to content

Commit

Permalink
fix: Fix tests instead of marking name safe
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Jul 21, 2023
1 parent 8a90897 commit d8b01ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions ietf/group/tests_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_review_requests(self):
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
self.assertContains(r, review_req.doc.name)
self.assertContains(r, assignment.reviewer.person.name)
self.assertContains(r, escape(assignment.reviewer.person.name))

url = urlreverse(ietf.group.views.review_requests, kwargs={ 'acronym': group.acronym })

Expand Down Expand Up @@ -183,7 +183,7 @@ def test_reviewer_overview(self):
urlreverse(ietf.group.views.reviewer_overview, kwargs={ 'acronym': group.acronym, 'group_type': group.type_id })]:
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
self.assertContains(r, reviewer.name)
self.assertContains(r, escape(reviewer.name))
self.assertContains(r, review_req1.doc.name)
# without a login, reason for being unavailable should not be seen
self.assertNotContains(r, "Availability")
Expand Down
21 changes: 10 additions & 11 deletions ietf/person/templatetags/person_filters.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright The IETF Trust 2017-2020, All Rights Reserved

from django import template
from django.utils.html import mark_safe

import debug # pyflakes:ignore

Expand Down Expand Up @@ -60,11 +59,11 @@ def person_link(person, **kwargs):
)
email = person.email_address()
return {
"name": mark_safe(name),
"plain_name": mark_safe(plain_name),
"email": mark_safe(email),
"title": mark_safe(title),
"class": mark_safe(cls),
"name": name,
"plain_name": plain_name,
"email": email,
"title": title,
"class": cls,
"with_email": with_email,
}
else:
Expand All @@ -84,10 +83,10 @@ def email_person_link(email, **kwargs):
)
email = email.address
return {
"name": mark_safe(name),
"plain_name": mark_safe(plain_name),
"email": mark_safe(email),
"title": mark_safe(title),
"class": mark_safe(cls),
"name": name,
"plain_name": plain_name,
"email": email,
"title": title,
"class": cls,
"with_email": with_email,
}

0 comments on commit d8b01ad

Please sign in to comment.