#32556: assertHTMLEqual gives a confusing error message with empty attributes
-------------------------------------+-------------------------------------
     Reporter:  Baptiste Mispelon    |                    Owner:  Hasan
                                     |  Ramezani
         Type:  Bug                  |                   Status:  new
    Component:  Testing framework    |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Baptiste Mispelon):

 * status:  closed => new
 * resolution:  fixed =>


Comment:

 Oh, that was fast. Thanks for the quick turnaround on this, but if I may
 I'd like to reopen this ticket and argue for a revert.

 This test was passing before and now fails (both assertions fail):
 {{{#!py
 def test_boolean_attribute2(self):
     html1 = '<input value="">'
     html2 = '<input value="value">'
     self.assertHTMLNotEqual(html1, html2)
     self.assertNotEqual(parse_html(html1), parse_html(html2))
 }}}



 I've been trying to think about how I would fix the original issue but I
 keep coming back to having an exhaustive list of known boolean attributes
 (the parser already has `SELF_CLOSING_TAGS` so there's some precedent). I
 don't see how else to fix this correctly.

 On the other hand I'm not opposed to having an incorrect parser with known
 limitations but I think the limitations should be documented.

 I also think that having `__eq__` and `__str__` use separate codepaths
 will lead to more issues. Why can't we have `def __eq__(self, other):
 return str(self) == str(other)`?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32556#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.68b40aedfb65df7078d40326a9dfaab3%40djangoproject.com.

Reply via email to