﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31378	Support bytes in assertXMLEqual()/assertXMLNotEqual().	Joe Germuska	nobody	"In writing a test case, I found that passing the test client's `response.content` object into `TestCase.assertXMLEqual()` resulted in this error: `a bytes-like object is required, not 'str'`

In 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`.  

The 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`.

"	New feature	closed	Testing framework	dev	Normal	wontfix			Unreviewed	0	0	0	0	0	0
