summaryrefslogtreecommitdiff
path: root/tests/modeltests/test_client
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-14 06:05:54 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-14 06:05:54 +0000
commiteabb57f6f089bbd3c528eddc93ad61829afb5d7a (patch)
treeb5b032cbc906f2b4ffda0146779c18b93ed6a9bd /tests/modeltests/test_client
parent2083c53afce6403d5822e80b4c5dc0b0555708c8 (diff)
Fixed tests to match new HTTP redirect behaviour. We always redirect to absolute URLs now.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6169 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/test_client')
-rw-r--r--tests/modeltests/test_client/models.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/modeltests/test_client/models.py b/tests/modeltests/test_client/models.py
index 5e1eb529c0..1ba86a4a41 100644
--- a/tests/modeltests/test_client/models.py
+++ b/tests/modeltests/test_client/models.py
@@ -84,7 +84,7 @@ class ClientTest(TestCase):
"GET a URL that redirects elsewhere"
response = self.client.get('/test_client/redirect_view/')
# Check that the response was a 302 (redirect)
- self.assertRedirects(response, '/test_client/get_view/')
+ self.assertRedirects(response, 'http://testserver/test_client/get_view/')
client_providing_host = Client(HTTP_HOST='django.testserver')
response = client_providing_host.get('/test_client/redirect_view/')
@@ -96,13 +96,13 @@ class ClientTest(TestCase):
response = self.client.get('/test_client/redirect_view/', {'var': 'value'})
# Check if parameters are intact
- self.assertRedirects(response, '/test_client/get_view/?var=value')
+ self.assertRedirects(response, 'http://testserver/test_client/get_view/?var=value')
def test_permanent_redirect(self):
"GET a URL that redirects permanently elsewhere"
response = self.client.get('/test_client/permanent_redirect_view/')
# Check that the response was a 301 (permanent redirect)
- self.assertRedirects(response, '/test_client/get_view/', status_code=301)
+ self.assertRedirects(response, 'http://testserver/test_client/get_view/', status_code=301)
client_providing_host = Client(HTTP_HOST='django.testserver')
response = client_providing_host.get('/test_client/permanent_redirect_view/')
@@ -115,7 +115,7 @@ class ClientTest(TestCase):
# Check that the response was a 302, and that
# the attempt to get the redirection location returned 301 when retrieved
- self.assertRedirects(response, '/test_client/permanent_redirect_view/', target_status_code=301)
+ self.assertRedirects(response, 'http://testserver/test_client/permanent_redirect_view/', target_status_code=301)
def test_notfound_response(self):
"GET a URL that responds as '404:Not Found'"
@@ -239,7 +239,7 @@ class ClientTest(TestCase):
# Get the page without logging in. Should result in 302.
response = self.client.get('/test_client/login_protected_view/')
- self.assertRedirects(response, '/accounts/login/?next=/test_client/login_protected_view/')
+ self.assertRedirects(response, 'http://testserver/accounts/login/?next=/test_client/login_protected_view/')
# Log in
login = self.client.login(username='testclient', password='password')
@@ -277,7 +277,7 @@ class ClientTest(TestCase):
# Request a page that requires a login
response = self.client.get('/test_client/login_protected_view/')
- self.assertRedirects(response, '/accounts/login/?next=/test_client/login_protected_view/')
+ self.assertRedirects(response, 'http://testserver/accounts/login/?next=/test_client/login_protected_view/')
def test_session_modifying_view(self):
"Request a page that modifies the session"