{{ title }}
{% endif %}{% endblock %} + {% block content_subtitle %}{% if subtitle %}{{ subtitle }}
{% endif %}{% endblock %} {% block content %} {% block object-tools %}{% endblock %} {{ content }} diff --git a/django/contrib/admin/templates/admin/base_site.html b/django/contrib/admin/templates/admin/base_site.html index cae0a691e3..9e8cc604c5 100644 --- a/django/contrib/admin/templates/admin/base_site.html +++ b/django/contrib/admin/templates/admin/base_site.html @@ -1,6 +1,6 @@ {% extends "admin/base.html" %} -{% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %} +{% block title %}{% if subtitle %}{{ subtitle }} | {% endif %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %} {% block branding %}{{ site_header|default:_('Django administration') }}
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 62aa236e2b..61894de9f0 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -100,10 +100,16 @@ class AdminViewBasicTestCase(TestCase): cls.superuser = User.objects.create_superuser(username='super', password='secret', email='super@example.com') cls.s1 = Section.objects.create(name='Test section') cls.a1 = Article.objects.create( - content='Middle content
', date=datetime.datetime(2008, 3, 18, 11, 54, 58), section=cls.s1 + content='Middle content
', + date=datetime.datetime(2008, 3, 18, 11, 54, 58), + section=cls.s1, + title='Article 1', ) cls.a2 = Article.objects.create( - content='Oldest content
', date=datetime.datetime(2000, 3, 18, 11, 54, 58), section=cls.s1 + content='Oldest content
', + date=datetime.datetime(2000, 3, 18, 11, 54, 58), + section=cls.s1, + title='Article 2', ) cls.a3 = Article.objects.create( content='Newest content
', date=datetime.datetime(2009, 3, 18, 11, 54, 58), section=cls.s1 @@ -1027,6 +1033,53 @@ class AdminViewBasicTest(AdminViewBasicTestCase): self.assertContains(response, '