aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests/renderers.py
diff options
context:
space:
mode:
authorJacob Magnusson2012-11-04 13:42:29 +0100
committerJacob Magnusson2012-11-04 13:42:29 +0100
commit7df7dadccdba83d87fcc1ec6b5977fde26aab881 (patch)
tree9e0e66fd68bac1bce0fca88469b4b59f30003179 /rest_framework/tests/renderers.py
parentbd5a3ee7d52308fe6c6afc4dcb4b39c061e1c7e6 (diff)
downloaddjango-rest-framework-7df7dadccdba83d87fcc1ec6b5977fde26aab881.tar.bz2
Remove `request' from response instance while
testing caching
Diffstat (limited to 'rest_framework/tests/renderers.py')
-rw-r--r--rest_framework/tests/renderers.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/rest_framework/tests/renderers.py b/rest_framework/tests/renderers.py
index 1dd03c80..9be4b114 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):