          }
          response = self.post(login_path, data=form_data, **extra)
  
          # Login page should 302 redirect to the originally requested page
          if response.status_code != 302 or response['Location'] != path:
              return False
  
          # Since we are logged in, request the actual page again
          return self.get(path)
 
</s> remove         login_path, data = response['Location'].split('?')
 </s> add         _, _, login_path, _, data, _= urlparse(response['Location'])
        if (response.status_code != 302 or 
                urlparse(response['Location'])[2] != path):
          }
          response = self.post(login_path, data=form_data, **extra)
  
          # Login page should 302 redirect to the originally requested page
        if (response.status_code != 302 or 
                urlparse(response['Location'])[2] != path):
              return False
  
          # Since we are logged in, request the actual page again
          return self.get(path)
keep keep keep keep replace keep keep keep keep
 Fixed #3210 -- Modified test Client.login() to use urlparse, allowing absolute URLs in the Location header. Thanks, Ben Dean Kawamura.


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