mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Refs #30399 -- Made assertHTMLEqual normalize character and entity references.
This commit is contained in:
parent
af5ec222cc
commit
48235ba807
4 changed files with 40 additions and 11 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue