          response = self.get(path)
          if response.status_code != 302:
              return False
  
          login_path, data = response['Location'].split('?')
          next = data.split('=')[1]
  
          # Second, GET the login page; required to set up cookies
          response = self.get(login_path, **extra)
          if response.status_code != 200:
 
</s> remove         if response.status_code != 302 or response['Location'] != path:
 </s> add         if (response.status_code != 302 or 
                urlparse(response['Location'])[2] != path):
        _, _, login_path, _, data, _= urlparse(response['Location'])
          response = self.get(path)
          if response.status_code != 302:
              return False
  
        _, _, login_path, _, data, _= urlparse(response['Location'])
          next = data.split('=')[1]
  
          # Second, GET the login page; required to set up cookies
          response = self.get(login_path, **extra)
          if response.status_code != 200:
keep keep keep keep replace keep 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