Changes between Initial Version and Version 1 of Ticket #24112
- Timestamp:
- Jan 9, 2015, 6:15:46 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24112 – Description
initial v1 16 16 }}} 17 17 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` 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`. 19 20 This means that the test will fail (with the error above) rather than erroring. 19 21 20 22 I 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.