diff options
| author | Dheerendra Rathor <dheeru.rathor14@gmail.com> | 2015-10-13 12:22:49 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-10-22 13:51:00 -0400 |
| commit | 59e85f09c6c8171d5b24290d455e351063d81f5a (patch) | |
| tree | 28a34fd9c29e7f252b62dddd5b3adc79a62ba7b0 /tests | |
| parent | 3f300efede9f9670f4c413ff85ad731def15992b (diff) | |
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 '/'.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/admin_views/test_adminsite.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/admin_views/test_adminsite.py b/tests/admin_views/test_adminsite.py index 575a15c23a..bc2e59923b 100644 --- a/tests/admin_views/test_adminsite.py +++ b/tests/admin_views/test_adminsite.py @@ -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'] |
