當前位置: 首頁>>代碼示例>>Python>>正文


Python EntryDiscussions.link方法代碼示例

本文整理匯總了Python中zinnia.feeds.EntryDiscussions.link方法的典型用法代碼示例。如果您正苦於以下問題:Python EntryDiscussions.link方法的具體用法?Python EntryDiscussions.link怎麽用?Python EntryDiscussions.link使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在zinnia.feeds.EntryDiscussions的用法示例。


在下文中一共展示了EntryDiscussions.link方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_entry_discussions

# 需要導入模塊: from zinnia.feeds import EntryDiscussions [as 別名]
# 或者: from zinnia.feeds.EntryDiscussions import link [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]), '')
開發者ID:Alex-Tracer,項目名稱:django-blog-zinnia,代碼行數:15,代碼來源:feeds.py

示例2: test_entry_discussions

# 需要導入模塊: from zinnia.feeds import EntryDiscussions [as 別名]
# 或者: from zinnia.feeds.EntryDiscussions import link [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)
開發者ID:nkeilar,項目名稱:django-blog-zinnia,代碼行數:16,代碼來源:feeds.py

示例3: test_entry_discussions

# 需要導入模塊: from zinnia.feeds import EntryDiscussions [as 別名]
# 或者: from zinnia.feeds.EntryDiscussions import link [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]),
                       self.author.__unicode__())
     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)
開發者ID:AmiZya,項目名稱:django-blog-zinnia,代碼行數:24,代碼來源:feeds.py


注:本文中的zinnia.feeds.EntryDiscussions.link方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。