Changes between Initial Version and Version 1 of Ticket #31378


Ignore:
Timestamp:
Mar 18, 2020, 11:50:09 AM (5 years ago)
Author:
Joe Germuska
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31378 – Description

    initial v1  
    33In tracing the code, this originates from [https://github.com/django/django/blob/ba4389a36b5fb1afce0cddb4e28233138b6612b7/django/test/utils.py#L586-L587 django.test.utils.compare_xml], where string literals `\\n` and `\n` are passed to `replace()` even though the types of `want` and `got` (particularly `got`) may be `bytes` and not `str`. 
    44
    5 The workaround is to decode the response content (`response.content.decode('utf-8')`) and to pass the assertion comparison ("want") also as a string, but if this method is going to be used in the testing framework, it seems that it should tolerate directly passing in `response.content`, even if that's a `bytes`.
     5The workaround is to decode the response content before calling `assertXMLEqual` (`response.content.decode('utf-8')`) and to pass the assertion comparison ("want") also as a string, but if this method is going to be used in the testing framework, it seems that it should tolerate directly passing in `response.content`, even if that's a `bytes`.
     6
Back to Top