示例#1
0
    def test_is_well_setup(self):
        """ Test that base parameters are Ok """

        self.assertEqual(self.articlefeed.link, '/articles/')
        reftitle = u'Articles sur {}'.format(
            settings.ZDS_APP['site']['litteral_name'])
        self.assertEqual(self.articlefeed.title, reftitle)
        refdescription = u'Les derniers articles parus sur {}.'.format(
            settings.ZDS_APP['site']['litteral_name'])
        self.assertEqual(self.articlefeed.description, refdescription)

        atom = LastArticlesFeedATOM()
        self.assertEqual(atom.subtitle, refdescription)
示例#2
0
    def test_is_well_setup(self):
        """ Test that base parameters are Ok """

        self.assertEqual(self.articlefeed.link, "/articles/")
        reftitle = "Articles sur {}".format(
            overridden_zds_app["site"]["literal_name"])
        self.assertEqual(self.articlefeed.title, reftitle)
        refdescription = "Les derniers articles parus sur {}.".format(
            overridden_zds_app["site"]["literal_name"])
        self.assertEqual(self.articlefeed.description, refdescription)

        atom = LastArticlesFeedATOM()
        self.assertEqual(atom.subtitle, refdescription)
示例#3
0
# coding: utf-8

from django.conf.urls import url

from zds.tutorialv2.views.views_published import ListArticles, DisplayOnlineArticle, DownloadOnlineArticle
from zds.tutorialv2.feeds import LastArticlesFeedRSS, LastArticlesFeedATOM

urlpatterns = [
    # Flux
    url(r'^flux/rss/$', LastArticlesFeedRSS(), name='feed-rss'),
    url(r'^flux/atom/$', LastArticlesFeedATOM(), name='feed-atom'),

    # View
    url(r'^(?P<pk>\d+)/(?P<slug>.+)/$',
        DisplayOnlineArticle.as_view(),
        name='view'),

    # Downloads
    url(r'^md/(?P<pk>\d+)/(?P<slug>.+)\.md$',
        DownloadOnlineArticle.as_view(requested_file='md'),
        name='download-md'),
    url(r'^html/(?P<pk>\d+)/(?P<slug>.+)\.html$',
        DownloadOnlineArticle.as_view(requested_file='html'),
        name='download-html'),
    url(r'^pdf/(?P<pk>\d+)/(?P<slug>.+)\.pdf$',
        DownloadOnlineArticle.as_view(requested_file='pdf'),
        name='download-pdf'),
    url(r'^epub/(?P<pk>\d+)/(?P<slug>.+)\.epub$',
        DownloadOnlineArticle.as_view(requested_file='epub'),
        name='download-epub'),
    url(r'^zip/(?P<pk>\d+)/(?P<slug>.+)\.zip$',
示例#4
0
from django.urls import path, re_path
from django.views.generic.base import RedirectView

from zds.tutorialv2.views.contributors import ContentOfContributors
from zds.tutorialv2.views.lists import TagsListView, ContentOfAuthor
from zds.tutorialv2.views.download_online import DownloadOnlineArticle
from zds.tutorialv2.views.display import DisplayOnlineArticle
from zds.tutorialv2.feeds import LastArticlesFeedRSS, LastArticlesFeedATOM

urlpatterns = [
    # Flux
    re_path(r"^flux/rss/$", LastArticlesFeedRSS(), name="feed-rss"),
    re_path(r"^flux/atom/$", LastArticlesFeedATOM(), name="feed-atom"),
    # View
    re_path(r"^(?P<pk>\d+)/(?P<slug>.+)/$",
            DisplayOnlineArticle.as_view(),
            name="view"),
    # Downloads
    re_path(r"^md/(?P<pk>\d+)/(?P<slug>.+)\.md$",
            DownloadOnlineArticle.as_view(requested_file="md"),
            name="download-md"),
    re_path(
        r"^html/(?P<pk>\d+)/(?P<slug>.+)\.html$",
        DownloadOnlineArticle.as_view(requested_file="html"),
        name="download-html",
    ),
    re_path(r"^pdf/(?P<pk>\d+)/(?P<slug>.+)\.pdf$",
            DownloadOnlineArticle.as_view(requested_file="pdf"),
            name="download-pdf"),
    re_path(r"^tex/(?P<pk>\d+)/(?P<slug>.+)\.tex$",
            DownloadOnlineArticle.as_view(requested_file="tex"),