diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-02-13 12:32:01 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-02-13 12:32:01 +0000 |
| commit | bf11ab2b212de5bfee143d6e53584434d85b32a7 (patch) | |
| tree | db75190a242656f6dd7aaca140ecd3efb1b09b9a /django/test | |
| parent | 0e9f1553e1e5766559b077483ae445af11d9bb82 (diff) | |
[1.1.X] Fixed #12011 -- Modified the test client to preserve the request scheme on a redirect. Thanks to tgardner for the report and patch.
Backport of r12419 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12421 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/test')
| -rw-r--r-- | django/test/client.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/django/test/client.py b/django/test/client.py index d56472c1ae..60dcfb4309 100644 --- a/django/test/client.py +++ b/django/test/client.py @@ -465,11 +465,15 @@ class Client(object): redirect_chain = response.redirect_chain redirect_chain.append((url, response.status_code)) + extra = {} + if scheme: + extra['wsgi.url_scheme'] = scheme + # The test client doesn't handle external links, # but since the situation is simulated in test_client, # we fake things here by ignoring the netloc portion of the # redirected URL. - response = self.get(path, QueryDict(query), follow=False) + response = self.get(path, QueryDict(query), follow=False, **extra) response.redirect_chain = redirect_chain # Prevent loops |
