summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-03-07 00:12:02 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-03-07 00:12:02 +0000
commitee31d7124f111d492882d36461e55a8e2d778896 (patch)
tree5db0315e3751007613151987fed79d0c0d8a256e
parent20cf3b82a1f4f7a2feb8e74152e581e621b37e89 (diff)
[1.2.X] Fixed #15554 -- Corrected test failure in contenttypes when default site isn't example.com. Thanks to twil for the report, and PaulM for the patch.
Backport of r15766 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15767 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/contenttypes/tests.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/contrib/contenttypes/tests.py b/django/contrib/contenttypes/tests.py
index 7a1ca99d33..790193b289 100644
--- a/django/contrib/contenttypes/tests.py
+++ b/django/contrib/contenttypes/tests.py
@@ -63,9 +63,12 @@ class ContentTypesTests(TestCase):
obj = User.objects.create(username="john")
if Site._meta.installed:
+ current_site = Site.objects.get_current()
response = shortcut(request, user_ct.id, obj.id)
- self.assertEqual("http://example.com/users/john/", response._headers.get("location")[1])
+ self.assertEqual("http://%s/users/john/" % current_site.domain,
+ response._headers.get("location")[1])
Site._meta.installed = False
response = shortcut(request, user_ct.id, obj.id)
- self.assertEqual("http://Example.com/users/john/", response._headers.get("location")[1])
+ self.assertEqual("http://Example.com/users/john/",
+ response._headers.get("location")[1])