コード例 #1
0
ファイル: feeds.py プロジェクト: nkeilar/django-blog-zinnia
 def test_latest_entries(self):
     self.create_published_entry()
     feed = LatestEntries()
     self.assertEquals(feed.link(), "/")
     self.assertEquals(len(feed.items()), 1)
     self.assertEquals(feed.get_title(None), "Latest entries")
     self.assertEquals(feed.description(), "The latest entries for the site example.com")
コード例 #2
0
ファイル: feeds.py プロジェクト: kelsta/django-blog-zinnia
 def test_latest_entries(self):
     self.create_published_entry()
     feed = LatestEntries()
     self.assertEquals(feed.link(), '/')
     self.assertEquals(len(feed.items()), 1)
     self.assertEquals(feed.title(), 'example.com - %s' % _('Latest entries'))
     self.assertEquals(feed.description(),
                       _('The latest entries for the site %s') % 'example.com')
コード例 #3
0
 def test_latest_entries(self):
     self.create_published_entry()
     feed = LatestEntries()
     self.assertEqual(feed.link(), '/')
     self.assertEqual(len(feed.items()), 1)
     self.assertEqual(feed.get_title(None), 'Latest entries')
     self.assertEqual(
         feed.description(),
         'The latest entries on the site example.com')
コード例 #4
0
 def test_entry_feed_rss_or_atom(self):
     original_feeds_format = feeds.FEEDS_FORMAT
     feeds.FEEDS_FORMAT = ''
     feed = LatestEntries()
     self.assertEquals(feed.feed_type, DefaultFeed)
     feeds.FEEDS_FORMAT = 'atom'
     feed = LatestEntries()
     self.assertEquals(feed.feed_type, Atom1Feed)
     self.assertEquals(feed.subtitle, feed.description)
     feeds.FEEDS_FORMAT = original_feeds_format
コード例 #5
0
 def test_latest_entries(self):
     self.create_published_entry()
     feed = LatestEntries()
     self.assertEquals(feed.link(), '/')
     self.assertEquals(len(feed.items()), 1)
     self.assertEquals(feed.get_title(None), 'Latest entries')
     self.assertEquals(feed.description(),
                       'The latest entries for the site example.com')
コード例 #6
0
ファイル: feeds.py プロジェクト: jtrain/django-blog-zinnia
 def test_latest_entries(self):
     self.create_published_entry()
     feed = LatestEntries()
     self.assertEquals(feed.link(), '/')
     self.assertEquals(len(feed.items()), 1)
     self.assertEquals(feed.title(), 'example.com - %s' % _('Latest entries'))
     self.assertEquals(feed.description(),
                       _('The latest entries for the site %s') % 'example.com')
コード例 #7
0
 def test_title_with_sitename_implementation(self):
     feed = ZinniaFeed()
     self.assertRaises(NotImplementedError, feed.title)
     feed = LatestEntries()
     self.assertEquals(feed.title(), 'example.com - Latest entries')
コード例 #8
0
from zinnia.feeds import LatestEntries
from zinnia.feeds import TagEntries
from zinnia.feeds import AuthorEntries
from zinnia.feeds import CategoryEntries
from zinnia.feeds import SearchEntries
from zinnia.feeds import EntryComments
from zinnia.feeds import EntryPingbacks
from zinnia.feeds import EntryTrackbacks
from zinnia.feeds import EntryDiscussions
from zinnia.feeds import LatestDiscussions


urlpatterns = patterns(
    '',
    url(r'^$',
        LatestEntries(),
        name='zinnia_entry_latest_feed'),
    url(_(r'^discussions/$'),
        LatestDiscussions(),
        name='zinnia_discussion_latest_feed'),
    url(_(r'^search/$'),
        SearchEntries(),
        name='zinnia_entry_search_feed'),
    url(_(r'^tags/(?P<tag>[^/]+(?u))/$'),
        TagEntries(),
        name='zinnia_tag_feed'),
    url(_(r'^authors/(?P<username>[.+-@\w]+)/$'),
        AuthorEntries(),
        name='zinnia_author_feed'),
    url(_(r'^categories/(?P<path>[-\/\w]+)/$'),
        CategoryEntries(),
コード例 #9
0
 def test_latest_entries(self):
     self.create_published_entry()
     feed = LatestEntries()
     self.assertEquals(feed.link(), '/')
     self.assertEquals(len(feed.items()), 1)
コード例 #10
0
 def test_latest_entries(self):
     self.create_published_entry()
     feed = LatestEntries()
     self.assertEquals(feed.link(), '/')
     self.assertEquals(len(feed.items()), 1)
コード例 #11
0
from django.conf.urls import url

from zinnia.urls import _
from zinnia.feeds import LatestEntries
from zinnia.feeds import TagEntries
from zinnia.feeds import AuthorEntries
from zinnia.feeds import CategoryEntries
from zinnia.feeds import SearchEntries
from zinnia.feeds import EntryComments
from zinnia.feeds import EntryPingbacks
from zinnia.feeds import EntryTrackbacks
from zinnia.feeds import EntryDiscussions
from zinnia.feeds import LatestDiscussions

urlpatterns = [
    url(r'^$', LatestEntries(), name='entry_latest_feed'),
    url(_(r'^discussions/$'),
        LatestDiscussions(),
        name='discussion_latest_feed'),
    url(_(r'^search/$'), SearchEntries(), name='entry_search_feed'),
    url(_(r'^tags/(?P<tag>[^/]+(?u))/$'), TagEntries(), name='tag_feed'),
    url(_(r'^authors/(?P<username>[.+-@\w]+)/$'),
        AuthorEntries(),
        name='author_feed'),
    url(_(r'^categories/(?P<path>[-\/\w]+)/$'),
        CategoryEntries(),
        name='category_feed'),
    url(_(r'^discussions/(?P<year>\d{4})/(?P<month>\d{2})/'
          '(?P<day>\d{2})/(?P<slug>[-\w]+)/$'),
        EntryDiscussions(),
        name='entry_discussion_feed'),
コード例 #12
0
            AtomEntryDiscussions(),
            name='zinnia_entry_discussion_feed'),
        url(r'^comments/(?P<slug>[-\w]+)/$',
            AtomEntryComments(),
            name='zinnia_entry_comment_feed'),
        url(r'^pingbacks/(?P<slug>[-\w]+)/$',
            AtomEntryPingbacks(),
            name='zinnia_entry_pingback_feed'),
        url(r'^trackbacks/(?P<slug>[-\w]+)/$',
            AtomEntryTrackbacks(),
            name='zinnia_entry_trackback_feed'),
    )
else:
    urlpatterns = patterns(
        '',
        url(r'^latest/$', LatestEntries(), name='zinnia_entry_latest_feed'),
        url(r'^tags/(?P<slug>[- \w]+)/$', TagEntries(),
            name='zinnia_tag_feed'),
        url(r'^authors/(?P<username>[.+-@\w]+)/$',
            AuthorEntries(),
            name='zinnia_author_feed'),
        url(r'^categories/(?P<path>[-\/\w]+)/$',
            CategoryEntries(),
            name='zinnia_category_feed'),
        url(r'^search/(?P<slug>.*)/$',
            SearchEntries(),
            name='zinnia_entry_search_feed'),
        url(r'^discussions/(?P<slug>[-\w]+)/$',
            EntryDiscussions(),
            name='zinnia_entry_discussion_feed'),
        url(r'^comments/(?P<slug>[-\w]+)/$',