Source: djangorestframework Followup-For: Bug #1028871 In pygments (an upstream dependency) version 2.13.0, HTML rendering was updated[1] to use inline elements to encapsulate whitespace.
To address some resulting test failures, upstream pinned[2] to pygments version 2.12.0 recently. Currently Debian does not version pin the pygments dependency for djangorestframework. A fix could add version pinning, or alternatively apply a patch that extracts text contents from the received HTML document in the relevant test case(s); something like: import xml.etree.ElementTree as ET doc = ET.fromstring('<xml>hello<span class="w"> </span>there</xml>') "".join(doc.text) # hello there [1] - https://github.com/pygments/pygments/commit/147b22face65617514ccfa8512c6b097b07cad4c [2] - https://github.com/encode/django-rest-framework/pull/8530