Changeset 70
- Timestamp:
- 06/28/08 01:42:01 (2 months ago)
- Files:
-
- branches/pluggable-contents/common/tests.py (modified) (3 diffs)
- branches/pluggable-contents/plugins/tests.py (added)
- branches/pluggable-contents/plugins/views.py (modified) (3 diffs)
- branches/pluggable-contents/settings.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/pluggable-contents/common/tests.py
r35 r70 5 5 from lxml import etree 6 6 7 from django.contrib.sites.models import Site 8 from django.conf import settings 7 9 from django.test import TestCase 8 from django.contrib.sites.models import Site9 10 10 11 from blog.models import Entry … … 18 19 common's test. 19 20 """ 21 def setUp(self): 22 settings.SUB_CONTENTS = () 23 settings.EXTRA_CONTENTS = () 24 20 25 def test_sitemap(self): 21 26 """ … … 75 80 self.assertEqual(html.xpath('//head/title/text()')[0], 76 81 u'%s - %s' % (checked.title, CURRENT_SITE.name)) 82 77 83 # check context 78 84 context = response.context[-1] branches/pluggable-contents/plugins/views.py
r69 r70 9 9 from django.db import connection 10 10 from django.template import loader, Context 11 from django.utils.translation import ugettext_lazy as _ 11 12 12 13 from blog.models import Entry, Comment, TrackBack … … 245 246 'id': u'tag-list', 246 247 'obj_list': obj_list, 247 'title': u'Categories',248 'title': _(u'Categories'), 248 249 }) 249 250 t = loader.get_template('blog/_tag_cloud.html') 251 return t.render(c) 252 253 254 class RecentEntriesContent(Content): 255 """ 256 """ 257 def render(self): 258 # TODO: accessible this point. 259 obj_list = Entry.objects.filter(is_published__exact=True)\ 260 .filter(is_active__exact=True)[0:10] 261 c = Context({ 262 'MEDIA_URL': settings.MEDIA_URL, 263 'DESIGN_THEME': settings.DESIGN_THEME, 264 'id': u'comment-list', 265 'obj_list': obj_list, 266 'title': _(u'Recent Comments'), 267 }) 268 t = loader.get_template('blog/_links.html') 250 269 return t.render(c) 251 270 … … 262 281 'id': u'comment-list', 263 282 'obj_list': obj_list, 264 'title': u'Recent Comments',283 'title': _(u'Recent Comments'), 265 284 }) 266 285 t = loader.get_template('blog/_links.html') branches/pluggable-contents/settings.py
r69 r70 119 119 SUB_CONTENTS = ( 120 120 'plugins.views.TagCloudContent', 121 'plugins.views.Recent CommentsContent',121 'plugins.views.RecentEntriesContent', 122 122 ) 123 123 EXTRA_CONTENTS = ( 124 'plugins.views.RecentCommentsContent', 124 125 'plugins.views.ArchiveContent', 125 126 )
