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 /docs | |
| parent | af5ec222ccd24e81f9fec6c34836a4e503e7ccf7 (diff) | |
Refs #30399 -- Made assertHTMLEqual normalize character and entity references.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/3.0.txt | 5 | ||||
| -rw-r--r-- | docs/topics/testing/tools.txt | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/docs/releases/3.0.txt b/docs/releases/3.0.txt index 2b9c5c5ea0..335ab2c0d5 100644 --- a/docs/releases/3.0.txt +++ b/docs/releases/3.0.txt @@ -246,6 +246,11 @@ Tests * Tests and test cases to run can be selected by test name pattern using the new :option:`test -k` option. +* HTML comparison, as used by + :meth:`~django.test.SimpleTestCase.assertHTMLEqual`, now treats text, character + references, and entity references that refer to the same character as + equivalent. + URLs ~~~~ diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt index d9f508023c..6d37a7421d 100644 --- a/docs/topics/testing/tools.txt +++ b/docs/topics/testing/tools.txt @@ -1603,14 +1603,16 @@ your test suite. * The ordering of attributes of an HTML element is not significant. * Attributes without an argument are equal to attributes that equal in name and value (see the examples). + * Text, character references, and entity references that refer to the same + character are equivalent. The following examples are valid tests and don't raise any ``AssertionError``:: self.assertHTMLEqual( - '<p>Hello <b>world!</p>', + '<p>Hello <b>'world'!</p>', '''<p> - Hello <b>world! </b> + Hello <b>'world'! </b> </p>''' ) self.assertHTMLEqual( |
