          """
          obj = {'foo': ['bar', 'baz']}
          renderer = JSONRenderer()
          content = renderer.render(obj, 'application/json; indent=2')
          self.assertEqual(strip_trailing_whitespace(content.decode('utf-8')), _indented_repr)
  
  
  class UnicodeJSONRendererTests(TestCase):
      """
      Tests specific for the Unicode JSON Renderer
 
</s> remove         content = response.content.decode('utf8')
 </s> add         content = response.content.decode() </s> remove         # On python 2.x json.dumps() returns bytestrings if ensure_ascii=True,
        # but if ensure_ascii=False, the return type is underspecified,
        # and may (or may not) be unicode.
        # On python 3.x json.dumps() returns unicode strings.
        if isinstance(ret, str):
            # We always fully escape \u2028 and \u2029 to ensure we output JSON
            # that is a strict javascript subset. If bytes were returned
            # by json.dumps() then we don't have these characters in any case.
            # See: http://timelessrepo.com/json-isnt-a-javascript-subset
            ret = ret.replace('\u2028', '\\u2028').replace('\u2029', '\\u2029')
            return bytes(ret.encode('utf-8'))
        return ret
 </s> add         # We always fully escape \u2028 and \u2029 to ensure we output JSON
        # that is a strict javascript subset.
        # See: http://timelessrepo.com/json-isnt-a-javascript-subset
        ret = ret.replace('\u2028', '\\u2028').replace('\u2029', '\\u2029')
        return ret.encode() </s> remove         assert expected_error in response.rendered_content.decode('utf-8')
 </s> add         assert expected_error in response.rendered_content.decode() </s> remove             # On python 2.x the return type for json.dumps() is underspecified.
            # On python 3.x json.dumps() returns unicode strings.
            if isinstance(value, str):
                value = bytes(value.encode('utf-8'))
 </s> add             value = value.encode() </s> remove         self.stdout.write(output.decode('utf-8'))
 </s> add         self.stdout.write(output.decode())
        self.assertEqual(strip_trailing_whitespace(content.decode()), _indented_repr)
          """
          obj = {'foo': ['bar', 'baz']}
          renderer = JSONRenderer()
          content = renderer.render(obj, 'application/json; indent=2')
        self.assertEqual(strip_trailing_whitespace(content.decode()), _indented_repr)
  
  
  class UnicodeJSONRendererTests(TestCase):
      """
      Tests specific for the Unicode JSON Renderer
keep keep keep keep replace keep keep keep keep keep
 Drop default 'utf-8' to .encode()/.decode() (#6633)

A Python 3 cleanup that allows for less noise in the code.

https://docs.python.org/3/library/stdtypes.html#bytes.decode
https://docs.python.org/3/library/stdtypes.html#str.encode 
tests/test_renderers.py