1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #25519 -- Made the admin "View site" link point to sites running on a subpath.

Used request.META['SCRIPT_NAME'] as the site_url if it hasn't been
customized from the default value of '/'.
This commit is contained in:
Dheerendra Rathor
2015-10-13 12:22:49 +05:30
committed by Tim Graham
parent 3f300efede
commit 59e85f09c6
4 changed files with 23 additions and 2 deletions

View File

@@ -51,6 +51,11 @@ class SiteEachContextTest(TestCase):
self.assertEqual(ctx['site_url'], '/')
self.assertEqual(ctx['has_permission'], True)
def test_each_context_site_url_with_script_name(self):
request = RequestFactory().get(reverse('test_adminsite:index'), SCRIPT_NAME='/my-script-name/')
request.user = self.u1
self.assertEqual(site.each_context(request)['site_url'], '/my-script-name/')
def test_available_apps(self):
ctx = self.ctx
apps = ctx['available_apps']