              # 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.redirect_chain = redirect_chain
  
              # Prevent loops
              if response.redirect_chain[-1] in response.redirect_chain[0:-1]:
                  break
 
</s>
            response = self.get(path, QueryDict(query), follow=False, **extra)
              # 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, **extra)
              response.redirect_chain = redirect_chain
  
              # Prevent loops
              if response.redirect_chain[-1] in response.redirect_chain[0:-1]:
                  break
keep keep keep keep replace keep keep keep keep keep
 Fixed #12011 -- Modified the test client to preserve the request scheme on a redirect. Thanks to tgardner for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12419 bcc190cf-cafb-0310-a4f2-bffc1f526a37
django/test/client.py