diff options
| author | Rigel Di Scala <rigel.discala@propylon.com> | 2014-10-13 12:10:00 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-10-28 10:11:12 -0400 |
| commit | 28634394f53b9ab27d3419cfde047ee78e491d97 (patch) | |
| tree | 00a7e45cf79d6b2b468b94d9c183a2c384929627 /django | |
| parent | 713f23492a52df8dbb4ae1175f5d0a0f3e2c4005 (diff) | |
Fixed #23606 -- Implemented Client and RequestFactory trace() methods.
Thanks KevinEtienne for the suggestion.
Diffstat (limited to 'django')
| -rw-r--r-- | django/test/client.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/django/test/client.py b/django/test/client.py index b1ff33e3d3..fb8ff75e95 100644 --- a/django/test/client.py +++ b/django/test/client.py @@ -306,6 +306,10 @@ class RequestFactory(object): r.update(extra) return self.generic('HEAD', path, secure=secure, **r) + def trace(self, path, secure=False, **extra): + "Construct a TRACE request." + return self.generic('TRACE', path, secure=secure, **extra) + def options(self, path, data='', content_type='application/octet-stream', secure=False, **extra): "Construct an OPTIONS request." @@ -552,6 +556,15 @@ class Client(RequestFactory): response = self._handle_redirects(response, **extra) return response + def trace(self, path, data='', follow=False, secure=False, **extra): + """ + Send a TRACE request to the server. + """ + response = super(Client, self).trace(path, data=data, secure=secure, **extra) + if follow: + response = self._handle_redirects(response, **extra) + return response + def login(self, **credentials): """ Sets the Factory to appear as if it has successfully logged into a site. |
