summaryrefslogtreecommitdiff
path: root/tests/test_utils
diff options
context:
space:
mode:
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;'),