#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:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Baptiste Mispelon):

 I wrote a [https://github.com/django/django/pull/14148 new PR] using this
 approach:
 - declaring a list of known boolean attributes
 - using a single logic between `__str__` and `__eq__` (which is now a one-
 liner)

 While writing the patch I noticed that the previous behavior is sortof
 documented, as the documentation for `assertHTMLEqual` [1] says:

 > Attributes without an argument are equal to attributes that equal in
 name and value (see the examples).

 But the example only uses `checked` which is a boolean attribute so I'd
 argue it's not a breaking change.

 [1]
 
https://docs.djangoproject.com/en/dev/topics/testing/tools/#django.test.SimpleTestCase.assertHTMLEqual

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32556#comment:10>
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.42cc4921597c74d145271cac7e7bc3f3%40djangoproject.com.

Reply via email to