diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-05-09 06:55:32 -0700 |
|---|---|---|
| committer | Carlton Gibson <carlton.gibson@noumenal.es> | 2019-05-09 15:55:32 +0200 |
| commit | 48235ba807483fe349d2dc66aaeddc0d03f8b0d4 (patch) | |
| tree | 1004a9f7399e7d1363b38f79f8cb1929835db9af /tests/test_utils | |
| parent | af5ec222ccd24e81f9fec6c34836a4e503e7ccf7 (diff) | |
Refs #30399 -- Made assertHTMLEqual normalize character and entity references.
Diffstat (limited to 'tests/test_utils')
| -rw-r--r-- | tests/test_utils/tests.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 69a99d47d2..5b84bbd383 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -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> |
