[damned-lies] Fixed people tests (crossorigin missing)
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Fixed people tests (crossorigin missing)
- Date: Sat, 18 Jul 2020 12:22:08 +0000 (UTC)
commit cc769c397390e4f72cce27c1189d9861baf2be9f
Author: Claude Paroz <claude 2xlibre net>
Date: Sat Jul 18 14:21:21 2020 +0200
Fixed people tests (crossorigin missing)
people/tests.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/people/tests.py b/people/tests.py
index f823bb93..b65bf1ea 100644
--- a/people/tests.py
+++ b/people/tests.py
@@ -187,26 +187,30 @@ class PeopleTestCase(TestCase):
pn.image = 'http://www.example.org/my_image.png'
self.assertHTMLEqual(
people.people_image(pn),
- '<img class="img-circle" alt="John Nothing" onerror="this.onerror = null;
this.src=\'/static/img/nobody.png\'" src="http://www.example.org/my_image.png" />'
+ '<img class="img-circle" alt="John Nothing" onerror="this.onerror = null; '
+ 'this.src=\'/static/img/nobody.png\'" src="http://www.example.org/my_image.png" />'
)
pn.last_name = "<script>Some XSS content</script>"
self.assertIn("<script>Some XSS content</script>", people.people_image(pn))
self.assertHTMLEqual(
people.people_image(pn),
- '<img class="img-circle" alt="John <script>Some XSS content</script>"
onerror="this.onerror = null; this.src=\'/static/img/nobody.png\'" src="http://www.example.org/my_image.png"
/>'
+ '<img class="img-circle" alt="John <script>Some XSS content</script>" '
+ 'onerror="this.onerror = null; this.src=\'/static/img/nobody.png\'" '
+ 'src="http://www.example.org/my_image.png" />'
)
pn.avatar_service = 'gravatar.com'
self.assertHTMLEqual(
people.people_image(pn),
- '<img class="img-circle" alt="avatar icon"
src="https://secure.gravatar.com/avatar/618b8b6c1c973c780ec218242c49cbe7.jpg?s=80&d=identicon&r=g">'
+ '<img class="img-circle" alt="avatar icon" crossorigin="anonymous" '
+
'src="https://secure.gravatar.com/avatar/618b8b6c1c973c780ec218242c49cbe7.jpg?s=80&d=identicon&r=g">'
)
pn.avatar_service = 'libravatar.org'
self.assertHTMLEqual(
people.people_image(pn),
- '<img class="img-circle" alt="avatar icon"
src="https://seccdn.libravatar.org/avatar/618b8b6c1c973c780ec218242c49cbe7?s=80&d=identicon&r=g">'
+ '<img class="img-circle" alt="avatar icon" crossorigin="anonymous" '
+
'src="https://seccdn.libravatar.org/avatar/618b8b6c1c973c780ec218242c49cbe7?s=80&d=identicon&r=g">'
)
-
def test_get_image_size(self):
from people.forms import get_image_size
self.assertEqual(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]