summaryrefslogtreecommitdiff
path: root/tests/test_utils
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-05-09 08:18:18 -0700
committerCarlton Gibson <carlton.gibson@noumenal.es>2019-05-09 17:18:18 +0200
commitb7a33ee4f0f20e5b7e3dcd72d9b0c4c342c7f147 (patch)
tree7205c7818abb7c168914f83190d8da8cfc003974 /tests/test_utils
parentde6d3afb97454e0653d55adadcf0df7e2a03c088 (diff)
Fixed #30468 -- Fixed assertHTMLEqual() to handle all ASCII whitespace in a class attribute.
Diffstat (limited to 'tests/test_utils')
-rw-r--r--tests/test_utils/tests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
index c14746f344..2697590b77 100644
--- a/tests/test_utils/tests.py
+++ b/tests/test_utils/tests.py
@@ -613,6 +613,20 @@ class HTMLEqualTests(SimpleTestCase):
'<input type="text" id="id_name" />',
'<input type="password" id="id_name" />')
+ def test_class_attribute(self):
+ pairs = [
+ ('<p class="foo bar"></p>', '<p class="bar foo"></p>'),
+ ('<p class=" foo bar "></p>', '<p class="bar foo"></p>'),
+ ('<p class=" foo bar "></p>', '<p class="bar foo"></p>'),
+ ('<p class="foo\tbar"></p>', '<p class="bar foo"></p>'),
+ ('<p class="\tfoo\tbar\t"></p>', '<p class="bar foo"></p>'),
+ ('<p class="\t\t\tfoo\t\t\tbar\t\t\t"></p>', '<p class="bar foo"></p>'),
+ ('<p class="\t \nfoo \t\nbar\n\t "></p>', '<p class="bar foo"></p>'),
+ ]
+ for html1, html2 in pairs:
+ with self.subTest(html1):
+ self.assertHTMLEqual(html1, html2)
+
def test_normalize_refs(self):
pairs = [
('&#39;', '&#x27;'),