'Render L{UnauthorizedResource} for the given request object and verify
that the response code is I{Unauthorized} and that a I{WWW-Authenticate}
header is set in the response containing a challenge.'

def _unauthorizedRenderTest(self, request):

    resource = UnauthorizedResource([BasicCredentialFactory('example.com')])
    request.render(resource)
    self.assertEqual(request.responseCode, 401)
    self.assertEqual(request.responseHeaders.getRawHeaders('www-authenticate'), ['basic    realm="example.com"'])
