mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
Remove `request' from response instance while
testing caching
This commit is contained in:
parent
bd5a3ee7d5
commit
7df7dadccd
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user