From 7df7dadccdba83d87fcc1ec6b5977fde26aab881 Mon Sep 17 00:00:00 2001 From: Jacob Magnusson Date: Sun, 4 Nov 2012 13:42:29 +0100 Subject: [PATCH] Remove `request' from response instance while testing caching --- rest_framework/tests/renderers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rest_framework/tests/renderers.py b/rest_framework/tests/renderers.py index 1dd03c80d..9be4b1146 100644 --- a/rest_framework/tests/renderers.py +++ b/rest_framework/tests/renderers.py @@ -462,12 +462,13 @@ class CacheRenderTest(TestCase): def http_resp(self, http_method, url): """ Simple wrapper for Client http requests - Removes the `client' attribute from the response as an instance - of `django.test.client.Client' is not pickable + Removes the `client' and `request' attributes from as they are + added by django.test.client.Client and not part of caching + responses outside of tests. """ method = getattr(self.client, http_method) resp = method(url) - del resp.client + del resp.client, resp.request return resp def test_obj_pickling(self):