mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #30399 -- Made assertHTMLEqual normalize character and entity references.
This commit is contained in:
committed by
Carlton Gibson
parent
af5ec222cc
commit
48235ba807
@@ -612,6 +612,31 @@ class HTMLEqualTests(SimpleTestCase):
|
||||
'<input type="text" id="id_name" />',
|
||||
'<input type="password" id="id_name" />')
|
||||
|
||||
def test_normalize_refs(self):
|
||||
pairs = [
|
||||
(''', '''),
|
||||
(''', "'"),
|
||||
(''', '''),
|
||||
(''', "'"),
|
||||
("'", '''),
|
||||
("'", '''),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
('&', '&'),
|
||||
]
|
||||
for pair in pairs:
|
||||
with self.subTest(repr(pair)):
|
||||
self.assertHTMLEqual(*pair)
|
||||
|
||||
def test_complex_examples(self):
|
||||
self.assertHTMLEqual(
|
||||
"""<tr><th><label for="id_first_name">First name:</label></th>
|
||||
|
||||
Reference in New Issue
Block a user