  # Right now we expect this test to fail - I'm just going to leave it commented out.
  # Looking forward to actually being able to raise ExpectedFailure sometime!
  #
  #from django.test import TestCase
  #from djangorestframework.response import Response
  #
  #
  #class TestResponse(TestCase):
  #
  #    # Interface tests
  #
  #    # This is mainly to remind myself that the Response interface needs to change slightly
  #    def test_response_interface(self):
  #        """Ensure the Response interface is as expected."""
  #        response = Response()
  #        getattr(response, 'status')
  #        getattr(response, 'content')
  #        getattr(response, 'headers')
  
 
</s> remove         if self.view.response.status == 204:
            self.view.response.status = 200
 </s> add         if self.view.response.status_code == 204:
            self.view.response.status_code = 200 </s> remove         raise ErrorResponse(status.HTTP_200_OK, response_obj)
 </s> add         raise ErrorResponse(content=content, status=status.HTTP_200_OK) </s> remove 
        # Always add these headers.
        response.headers['Allow'] = ', '.join(self.allowed_methods)
        # sample to allow caching using Vary http header
        response.headers['Vary'] = 'Authenticate, Accept'

        # merge with headers possibly set at some point in the view
        response.headers.update(self.headers)
        return self.render(response)

    def add_header(self, field, value):
        """
        Add *field* and *value* to the :attr:`headers` attribute of the :class:`View` class.
        """
        self.headers[field] = value
 </s> add         return response </s> remove         self.raw_content = content      # content prior to filtering
        self.cleaned_content = content  # content after filtering
        self.headers = headers or {}
 </s> add         self.request = request
        if renderers is not None:
            self.renderers = renderers
        # TODO: must go
        self.view = None

    # TODO: wrap this behavior around dispatch(), ensuring it works
    # out of the box with existing Django classes that use render_to_response.
    @property
    def rendered_content(self):
        """
        """
        renderer, media_type = self._determine_renderer()
        # TODO: renderer *could* override media_type in .render() if required.

        # Set the media type of the response
        self['Content-Type'] = renderer.media_type

        # Render the response content
        if self.has_content_body:
            return renderer.render(self.raw_content, media_type)
        return renderer.render() </s> remove     def __init__(self, status=200, content=None, headers=None):
        self.status = status
        self.media_type = None
 </s> add     _ACCEPT_QUERY_PARAM = '_accept'        # Allow override of Accept header in URL query params
    _IGNORE_IE_ACCEPT_HEADER = True

    def __init__(self, content=None, status=None, request=None, renderers=None):
        """
        content is the raw content.

        The set of renderers that the response can handle.

        Should be a tuple/list of classes as described in the :mod:`renderers` module.
        """
        # First argument taken by `SimpleTemplateResponse.__init__` is template_name,
        # which we don't need
        super(Response, self).__init__(None, status=status)
        # We need to store our content in raw content to avoid overriding HttpResponse's
        # `content` property
        self.raw_content = content 
import json
import json
import json
import json
import json
import json
import json
import json
import json
import json
import json
import json
import json
import json
import json
import json
import json
import json
import json
  
replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep
 Response as a subclass of HttpResponse - first draft, not quite there yet. 
djangorestframework/tests/response.py