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:
committed by
Tim Graham
parent
3f300efede
commit
59e85f09c6
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user