mirror of
https://github.com/django/django.git
synced 2025-08-19 02:01:29 +00:00
Fixed #13749 -- Added link from admin site to front-end site.
Thanks romankrv for the suggestion.
This commit is contained in:
parent
6aae07fe61
commit
a81af7f49d
6 changed files with 28 additions and 0 deletions
|
@ -744,6 +744,15 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
|
|||
color2_delete_log = LogEntry.objects.all()[0]
|
||||
self.assertEqual(color2_content_type, color2_delete_log.content_type)
|
||||
|
||||
def test_adminsite_display_site_url(self):
|
||||
"""
|
||||
#13749 - Admin should display link to front-end site 'View site'
|
||||
"""
|
||||
url = reverse('admin:index')
|
||||
response = self.client.get(url)
|
||||
self.assertEqual(response.context['site_url'], '/my-site-url/')
|
||||
self.assertContains(response, '<a href="/my-site-url/">View site</a>')
|
||||
|
||||
|
||||
@override_settings(TEMPLATE_DIRS=ADMIN_VIEW_TEMPLATES_DIR)
|
||||
class AdminCustomTemplateTests(AdminViewBasicTestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue