Ticket #4988: django-test-redirect.patch

File django-test-redirect.patch, 1.2 KB (added by alex@…, 8 years ago)
  • django/test/client.py

     
    179179            else:
    180180                setattr(response, detail, None)
    181181
     182        response.test_client = self
     183
    182184        # Look for a signalled exception and reraise it
    183185        if self.exc_info:
    184186            raise self.exc_info[1], None, self.exc_info[2]
  • django/test/testcases.py

     
    6868        scheme, netloc, path, params, query, fragment = urlparse(response['Location'])
    6969        self.assertEqual(path, expected_path,
    7070            "Response redirected to '%s', expected '%s'" % (path, expected_path))
    71         redirect_response = self.client.get(path)
     71        redirect_response = response.test_client.get(path)
    7272        self.assertEqual(redirect_response.status_code, target_status_code,
    7373            "Couldn't retrieve redirection page '%s': response code was %d (expected %d)" %
    7474                (path, redirect_response.status_code, target_status_code))
Back to Top