From 9d0edbb7e3c339ecf4ce714a53ddcdbda457e6dd Mon Sep 17 00:00:00 2001 From: Kumar McMillan Date: Tue, 15 Mar 2011 18:35:44 -0500 Subject: [PATCH] Adds page title to editor review --- apps/editors/helpers.py | 4 ++-- apps/editors/templates/editors/review.html | 4 ++++ apps/editors/tests/test_views.py | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/editors/helpers.py b/apps/editors/helpers.py index 32bbe757b2..769a9640d4 100644 --- a/apps/editors/helpers.py +++ b/apps/editors/helpers.py @@ -26,8 +26,8 @@ def editor_page_title(context, title=None, addon=None): if addon: title = u'%s :: %s' % (title, addon.name) else: - devhub = _('Editor Tools') - title = '%s :: %s' % (title, devhub) if title else devhub + section = unicode(_('Editor Tools')) + title = '%s :: %s' % (title, section) if title else section return page_title(context, title) diff --git a/apps/editors/templates/editors/review.html b/apps/editors/templates/editors/review.html index 3da88f7ec8..20a4d518c0 100644 --- a/apps/editors/templates/editors/review.html +++ b/apps/editors/templates/editors/review.html @@ -1,5 +1,9 @@ {% extends "editors/base.html" %} +{% block title %} + {{ editor_page_title(title=addon.name) }} +{% endblock %} + {% block bodyclass %}inverse{% endblock %} {% block content %} diff --git a/apps/editors/tests/test_views.py b/apps/editors/tests/test_views.py index d34eeaba6a..c29b0b0cbc 100644 --- a/apps/editors/tests/test_views.py +++ b/apps/editors/tests/test_views.py @@ -813,6 +813,13 @@ class TestReview(ReviewBase): response = self.client.get(self.url) eq_(response.context['paging'], {}) + def test_page_title(self): + response = self.client.get(self.url) + eq_(response.status_code, 200) + doc = pq(response.content) + eq_(doc('title').text(), + '%s :: Editor Tools :: Add-ons' % self.addon.name) + def test_paging_num(self): response = self.client.get('%s?num=1' % self.url) eq_(response.context['paging']['prev'], False)