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
|
@ -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
|
||||
~~~~
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue