Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1877 from Bouke/patches/4

Fixed missing admindocs' site_header, refs #21293
  • Loading branch information...
commit 9c6b57f709bb6123d8abae6ba05e92085ec2f426 2 parents 3ac823f + 48ce09f
@claudep claudep authored
Showing with 9 additions and 1 deletion.
  1. +3 −1 django/contrib/admindocs/views.py
  2. +6 −0 tests/admin_docs/tests.py
View
4 django/contrib/admindocs/views.py
@@ -5,6 +5,7 @@
from django import template
from django.conf import settings
+from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.db import models
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
@@ -36,11 +37,12 @@ def dispatch(self, *args, **kwargs):
if not utils.docutils_is_available:
# Display an error message for people without docutils
self.template_name = 'admin_doc/missing_docutils.html'
- return self.render_to_response({})
+ return self.render_to_response(admin.site.each_context())
return super(BaseAdminDocsView, self).dispatch(*args, **kwargs)
def get_context_data(self, **kwargs):
kwargs.update({'root_path': urlresolvers.reverse('admin:index')})
+ kwargs.update(admin.site.each_context())
return super(BaseAdminDocsView, self).get_context_data(**kwargs)
View
6 tests/admin_docs/tests.py
@@ -25,6 +25,9 @@ def test_index(self):
self.client.login(username='super', password='secret')
response = self.client.get(reverse('django-admindocs-docroot'))
self.assertContains(response, '<h1>Documentation</h1>', html=True)
+ self.assertContains(response,
+ '<h1 id="site-name"><a href="/admin/">Django '
+ 'administration</a></h1>')
def test_bookmarklets(self):
response = self.client.get(reverse('django-admindocs-bookmarklets'))
@@ -80,6 +83,9 @@ def test_missing_docutils(self):
'<h3>The admin documentation system requires Python\'s '
'<a href="http://docutils.sf.net/">docutils</a> library.</h3>',
html=True)
+ self.assertContains(response,
+ '<h1 id="site-name"><a href="/admin/">Django '
+ 'administration</a></h1>')
finally:
utils.docutils_is_available = True
Please sign in to comment.
Something went wrong with that request. Please try again.