'The digest value must be correctly quoted.
It is a byte string in python3, so we must make sure the proper conversion is done'

def test_renderQuotesDigest(self):

    resource = UnauthorizedResource([digest.DigestCredentialFactory('md5', 'example\\"foo')])
    request = DummyRequest([''])
    request.render(resource)
    auth_header = request.responseHeaders.getRawHeaders('www-authenticate')[0]
    self.assertIn('realm="example\\\\\\"foo"', auth_header)
    self.assertIn('hm="md5', auth_header)
