From 39b2ac0c9cbc89a6af6e9c59ceb73b2d7f260dd0 Mon Sep 17 00:00:00 2001
From: Randy Barlow <randy@electronsweatshop.com>
Date: Tue, 15 Aug 2017 17:46:12 -0400
Subject: [PATCH] Patch the tests for CVE-2017-1002152 to pass with bleach 2.0.
Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
---
bodhi/tests/server/test_utils.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/bodhi/tests/server/test_utils.py b/bodhi/tests/server/test_utils.py
index e754f0f..38db86b 100644
--- a/bodhi/tests/server/test_utils.py
+++ b/bodhi/tests/server/test_utils.py
@@ -53,10 +53,10 @@ class TestBugLink(unittest.TestCase):
link = util.bug_link(None, bug)
- self.assertEqual(
- link,
- ("<a target='_blank' href='https://bugzilla.redhat.com/show_bug.cgi?id=1234567'>"
- "#1234567</a> Check <b>this</b> out"))
+ self.assertTrue(
+ link.startswith(
+ ("<a target='_blank' href='https://bugzilla.redhat.com/show_bug.cgi?id=1234567'>"
+ "#1234567</a> Check <b>this</b> out")))
def test_short_false_with_title_sanitizes_unsafe_tags(self):
"""
@@ -69,10 +69,10 @@ class TestBugLink(unittest.TestCase):
link = util.bug_link(None, bug)
- self.assertEqual(
- link,
- ("<a target='_blank' href='https://bugzilla.redhat.com/show_bug.cgi?id=1473091'>"
- "#1473091</a> <disk> <driver name=\"...\"> should be optional"))
+ self.assertTrue(
+ link.startswith(
+ ("<a target='_blank' href='https://bugzilla.redhat.com/show_bug.cgi?id=1473091'>"
+ "#1473091</a> <disk> <driver name=\"...\"> should be optional")))
def test_short_false_without_title(self):
"""Test a call to bug_link() with short=False on a Bug that has no title."""
--
2.9.4