mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 08:29:59 +03:00
Add retain test data on follow=True
This commit is contained in:
parent
a53e523f93
commit
162fcc397e
|
@ -288,7 +288,7 @@ class APIClient(APIRequestFactory, DjangoClient):
|
||||||
def get(self, path, data=None, follow=False, **extra):
|
def get(self, path, data=None, follow=False, **extra):
|
||||||
response = super().get(path, data=data, **extra)
|
response = super().get(path, data=data, **extra)
|
||||||
if follow:
|
if follow:
|
||||||
response = self._handle_redirects(response, **extra)
|
response = self._handle_redirects(response, data=data, **extra)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def post(self, path, data=None, format=None, content_type=None,
|
def post(self, path, data=None, format=None, content_type=None,
|
||||||
|
@ -296,7 +296,7 @@ class APIClient(APIRequestFactory, DjangoClient):
|
||||||
response = super().post(
|
response = super().post(
|
||||||
path, data=data, format=format, content_type=content_type, **extra)
|
path, data=data, format=format, content_type=content_type, **extra)
|
||||||
if follow:
|
if follow:
|
||||||
response = self._handle_redirects(response, **extra)
|
response = self._handle_redirects(response, data=data, format=format, content_type=content_type, **extra)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def put(self, path, data=None, format=None, content_type=None,
|
def put(self, path, data=None, format=None, content_type=None,
|
||||||
|
@ -304,7 +304,7 @@ class APIClient(APIRequestFactory, DjangoClient):
|
||||||
response = super().put(
|
response = super().put(
|
||||||
path, data=data, format=format, content_type=content_type, **extra)
|
path, data=data, format=format, content_type=content_type, **extra)
|
||||||
if follow:
|
if follow:
|
||||||
response = self._handle_redirects(response, **extra)
|
response = self._handle_redirects(response, data=data, format=format, content_type=content_type, **extra)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def patch(self, path, data=None, format=None, content_type=None,
|
def patch(self, path, data=None, format=None, content_type=None,
|
||||||
|
@ -312,7 +312,7 @@ class APIClient(APIRequestFactory, DjangoClient):
|
||||||
response = super().patch(
|
response = super().patch(
|
||||||
path, data=data, format=format, content_type=content_type, **extra)
|
path, data=data, format=format, content_type=content_type, **extra)
|
||||||
if follow:
|
if follow:
|
||||||
response = self._handle_redirects(response, **extra)
|
response = self._handle_redirects(response, data=data, format=format, content_type=content_type, **extra)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def delete(self, path, data=None, format=None, content_type=None,
|
def delete(self, path, data=None, format=None, content_type=None,
|
||||||
|
@ -320,7 +320,7 @@ class APIClient(APIRequestFactory, DjangoClient):
|
||||||
response = super().delete(
|
response = super().delete(
|
||||||
path, data=data, format=format, content_type=content_type, **extra)
|
path, data=data, format=format, content_type=content_type, **extra)
|
||||||
if follow:
|
if follow:
|
||||||
response = self._handle_redirects(response, **extra)
|
response = self._handle_redirects(response, data=data, format=format, content_type=content_type, **extra)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def options(self, path, data=None, format=None, content_type=None,
|
def options(self, path, data=None, format=None, content_type=None,
|
||||||
|
@ -328,7 +328,7 @@ class APIClient(APIRequestFactory, DjangoClient):
|
||||||
response = super().options(
|
response = super().options(
|
||||||
path, data=data, format=format, content_type=content_type, **extra)
|
path, data=data, format=format, content_type=content_type, **extra)
|
||||||
if follow:
|
if follow:
|
||||||
response = self._handle_redirects(response, **extra)
|
response = self._handle_redirects(response, data=data, format=format, content_type=content_type, **extra)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def logout(self):
|
def logout(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user