mirror of https://github.com/django/django.git
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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
75cd087c79
commit
6bf1c343ca
|
@ -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])
|
||||
|
|
Loading…
Reference in New Issue