本文整理匯總了Python中zinnia.feeds.EntryDiscussions.description方法的典型用法代碼示例。如果您正苦於以下問題:Python EntryDiscussions.description方法的具體用法?Python EntryDiscussions.description怎麽用?Python EntryDiscussions.description使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類zinnia.feeds.EntryDiscussions
的用法示例。
在下文中一共展示了EntryDiscussions.description方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_entry_discussions
# 需要導入模塊: from zinnia.feeds import EntryDiscussions [as 別名]
# 或者: from zinnia.feeds.EntryDiscussions import description [as 別名]
def test_entry_discussions(self):
entry = self.create_published_entry()
comments = self.create_discussions(entry)
feed = EntryDiscussions()
self.assertEquals(feed.get_object("request", 2010, 1, 1, entry.slug), entry)
self.assertEquals(feed.link(entry), "/2010/01/01/my-test-entry/")
self.assertEquals(len(feed.items(entry)), 3)
self.assertEquals(feed.item_pubdate(comments[0]), comments[0].submit_date)
self.assertEquals(feed.item_link(comments[0]), "/comments/cr/%i/1/#c1" % self.entry_ct_id)
self.assertEquals(feed.item_author_name(comments[0]), "admin")
self.assertEquals(feed.item_author_email(comments[0]), "[email protected]")
self.assertEquals(feed.item_author_link(comments[0]), "")
self.assertEquals(feed.get_title(entry), "Discussions on %s" % entry.title)
self.assertEquals(feed.description(entry), "The latest discussions for the entry %s" % entry.title)
示例2: test_entry_discussions
# 需要導入模塊: from zinnia.feeds import EntryDiscussions [as 別名]
# 或者: from zinnia.feeds.EntryDiscussions import description [as 別名]
def test_entry_discussions(self):
entry = self.create_published_entry()
comments = self.create_discussions(entry)
feed = EntryDiscussions()
self.assertEquals(feed.get_object('request', entry.slug), entry)
self.assertEquals(feed.link(entry), '/2010/01/01/my-test-entry/')
self.assertEquals(len(feed.items(entry)), 3)
self.assertEquals(feed.item_pubdate(comments[0]), comments[0].submit_date)
self.assertEquals(feed.item_link(comments[0]),
'/comments/cr/%i/1/#c1' % self.entry_ct_id)
self.assertEquals(feed.item_author_name(comments[0]), 'admin')
self.assertEquals(feed.item_author_email(comments[0]), '[email protected]')
self.assertEquals(feed.item_author_link(comments[0]), '')
self.assertEquals(feed.title(entry),
_('Discussions on %s') % entry.title)
self.assertEquals(feed.description(entry),
_('The latest discussions for the entry %s') % entry.title)
示例3: test_entry_discussions
# 需要導入模塊: from zinnia.feeds import EntryDiscussions [as 別名]
# 或者: from zinnia.feeds.EntryDiscussions import description [as 別名]
def test_entry_discussions(self):
entry = self.create_published_entry()
comments = self.create_discussions(entry)
feed = EntryDiscussions()
self.assertEqual(feed.get_object(
'request', 2010, 1, 1, entry.slug), entry)
self.assertEqual(feed.link(entry), '/2010/01/01/my-test-entry/')
self.assertEqual(len(feed.items(entry)), 3)
self.assertEqual(feed.item_pubdate(comments[0]),
comments[0].submit_date)
self.assertEqual(feed.item_link(comments[0]),
'/comments/cr/%i/%i/#c%i' %
(self.entry_ct_id, entry.pk, comments[0].pk))
self.assertEqual(feed.item_author_name(comments[0]),
self.author.get_full_name())
self.assertEqual(feed.item_author_email(comments[0]),
'[email protected]')
self.assertEqual(feed.item_author_link(comments[0]), '')
self.assertEqual(feed.get_title(entry),
'Discussions on %s' % entry.title)
self.assertEqual(
feed.description(entry),
'The last discussions on the entry %s' % entry.title)