diff options
| author | José Padilla | 2014-11-28 12:14:40 -0400 | 
|---|---|---|
| committer | José Padilla | 2014-11-28 12:14:40 -0400 | 
| commit | 0cc990792c63caa8fa8fea62cea53b0d28157b55 (patch) | |
| tree | 7ea80a203cc8718150cd55e4403f3f4771160281 /rest_framework/test.py | |
| parent | 1aa77830955dcdf829f65a9001b6b8900dfc8755 (diff) | |
| parent | 3a5b3772fefc3c2f2c0899947cbc07bfe6e6b5d2 (diff) | |
| download | django-rest-framework-0cc990792c63caa8fa8fea62cea53b0d28157b55.tar.bz2 | |
Merge branch 'version-3.1' into oauth_as_package
Conflicts:
	requirements-test.txt
	rest_framework/compat.py
	tests/settings.py
	tox.ini
Diffstat (limited to 'rest_framework/test.py')
| -rw-r--r-- | rest_framework/test.py | 46 | 
1 files changed, 46 insertions, 0 deletions
| diff --git a/rest_framework/test.py b/rest_framework/test.py index 9b40353a..74d2c868 100644 --- a/rest_framework/test.py +++ b/rest_framework/test.py @@ -156,6 +156,52 @@ class APIClient(APIRequestFactory, DjangoClient):          kwargs.update(self._credentials)          return super(APIClient, self).request(**kwargs) +    def get(self, path, data=None, follow=False, **extra): +        response = super(APIClient, self).get(path, data=data, **extra) +        if follow: +            response = self._handle_redirects(response, **extra) +        return response + +    def post(self, path, data=None, format=None, content_type=None, +             follow=False, **extra): +        response = super(APIClient, self).post( +            path, data=data, format=format, content_type=content_type, **extra) +        if follow: +            response = self._handle_redirects(response, **extra) +        return response + +    def put(self, path, data=None, format=None, content_type=None, +            follow=False, **extra): +        response = super(APIClient, self).put( +            path, data=data, format=format, content_type=content_type, **extra) +        if follow: +            response = self._handle_redirects(response, **extra) +        return response + +    def patch(self, path, data=None, format=None, content_type=None, +              follow=False, **extra): +        response = super(APIClient, self).patch( +            path, data=data, format=format, content_type=content_type, **extra) +        if follow: +            response = self._handle_redirects(response, **extra) +        return response + +    def delete(self, path, data=None, format=None, content_type=None, +               follow=False, **extra): +        response = super(APIClient, self).delete( +            path, data=data, format=format, content_type=content_type, **extra) +        if follow: +            response = self._handle_redirects(response, **extra) +        return response + +    def options(self, path, data=None, format=None, content_type=None, +                follow=False, **extra): +        response = super(APIClient, self).options( +            path, data=data, format=format, content_type=content_type, **extra) +        if follow: +            response = self._handle_redirects(response, **extra) +        return response +      def logout(self):          self._credentials = {}          return super(APIClient, self).logout() | 
