diff options
| author | Baptiste Mispelon <bmispelon@gmail.com> | 2021-03-19 00:43:38 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-19 20:41:57 +0100 |
| commit | 41e6b2a3c5e723256506b9ff49437d52a1f3bf43 (patch) | |
| tree | 5afcbf95e26a870e4ddcfbbd2a0e96b6aaed1dd6 /docs | |
| parent | 98abf80cde0a7b6846f2612ee8ec9189adccdc3c (diff) | |
Fixed #32556 -- Fixed handling empty string as non-boolean attributes value by assertHTMLEqual().
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/4.0.txt | 4 | ||||
| -rw-r--r-- | docs/topics/testing/tools.txt | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/docs/releases/4.0.txt b/docs/releases/4.0.txt index 6f10124c0c..2b82c62d02 100644 --- a/docs/releases/4.0.txt +++ b/docs/releases/4.0.txt @@ -362,6 +362,10 @@ Miscellaneous ``EmailMessage.attach()`` with an invalid ``content`` or ``mimetype`` arguments now raise ``ValueError`` instead of ``AssertionError``. +* :meth:`~django.test.SimpleTestCase.assertHTMLEqual` no longer considers a + non-boolean attribute without a value equal to an attribute with the same + name and value. + .. _deprecated-features-4.0: Features deprecated in 4.0 diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt index 70b7f2df5c..02da186aa2 100644 --- a/docs/topics/testing/tools.txt +++ b/docs/topics/testing/tools.txt @@ -1596,8 +1596,8 @@ your test suite. closed or the HTML document ends. * Empty tags are equivalent to their self-closing version. * 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). + * Boolean attributes (like ``checked``) 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. @@ -1620,6 +1620,12 @@ your test suite. Output in case of error can be customized with the ``msg`` argument. + .. versionchanged:: 4.0 + + In older versions, any attribute (not only boolean attributes) without + a value was considered equal to an attribute with the same name and + value. + .. method:: SimpleTestCase.assertHTMLNotEqual(html1, html2, msg=None) Asserts that the strings ``html1`` and ``html2`` are *not* equal. The |
