Changes between Initial Version and Version 1 of Ticket #24112


Ignore:
Timestamp:
01/09/2015 06:15:46 PM (2 years ago)
Author:
Andrew Plummer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24112 – Description

    initial v1  
    1616}}}
    1717
    18 Which seems wrong. It doesn't handle the case correctly if the needle doesn't have a single top-level element (unless the two bits of html are equivalent). This is down to the  `_count` method of `django.test.html.Element`
     18Which seems wrong. It doesn't handle the case correctly if the needle doesn't have a single top-level element (unless the two bits of html are equivalent). This is down to the  `_count` method of `django.test.html.Element`.
     19
     20This means that the test will fail (with the error above) rather than erroring.
    1921
    2022I think this should throw a ValueError if the needle has multiple top level elements. However, this does change existing behaviour for the case where the html fragments are equivalent. An alternative would be to try to correctly handle the count in this case, which is possibly a bit fiddly, and the current implementation appears to make no attempt to do this.
Back to Top