Ticket #4988: django-test-redirect.patch
File django-test-redirect.patch, 1.2 KB (added by , 17 years ago) |
---|
-
django/test/client.py
179 179 else: 180 180 setattr(response, detail, None) 181 181 182 response.test_client = self 183 182 184 # Look for a signalled exception and reraise it 183 185 if self.exc_info: 184 186 raise self.exc_info[1], None, self.exc_info[2] -
django/test/testcases.py
68 68 scheme, netloc, path, params, query, fragment = urlparse(response['Location']) 69 69 self.assertEqual(path, expected_path, 70 70 "Response redirected to '%s', expected '%s'" % (path, expected_path)) 71 redirect_response = self.client.get(path)71 redirect_response = response.test_client.get(path) 72 72 self.assertEqual(redirect_response.status_code, target_status_code, 73 73 "Couldn't retrieve redirection page '%s': response code was %d (expected %d)" % 74 74 (path, redirect_response.status_code, target_status_code))