def test_default_content_type(self):
     """
     If the Content-Type response header is not already set, set it based
     on the defaults
     """
     request = DummyRequest()
     resource = Resource()
     resource.DEFAULT_CONTENT_TYPE = frozenset(["application/pyfarm"])
     resource.render_tuple(request, ("body", OK, {}))
     self.assertEqual(
         request.responseHeaders.getRawHeaders("Content-Type"),
         ["application/pyfarm"]
     )
 def test_content_type_already_set(self):
     """
     If the Content-Type response header is already set, do not set
     it again.
     """
     request = DummyRequest()
     resource = Resource()
     resource.DEFAULT_CONTENT_TYPE = frozenset(["application/foobar"])
     resource.render_tuple(
         request, ("body", OK, {"Content-Type": ["application/pyfarm"]})
     )
     self.assertEqual(
         request.responseHeaders.getRawHeaders("Content-Type"),
         ["application/pyfarm"]
     )