def test_passes_cookies_through_to_request(self): request = Mock() view = ProxyView() view.get_cookies = lambda r: {'test_cookie': 'value'} factory = APIRequestFactory() request = factory.post('some/url', data={}, cookies={'original_request_cookie': 'I will not get passed'}) request.content_type = 'application/json' request.query_params = '' request.data = {} with patch('rest_framework_proxy.views.requests.request') as patched_requests: with patch.object(view, 'create_response'): view.proxy(request) args, kwargs = patched_requests.call_args request_cookies = kwargs['cookies'] self.assertEqual(request_cookies, {'test_cookie': 'value'})