Esempio n. 1
0
    def test_htmls_urls_are_returned(self):
        article = modelfactories.ArticleFactory.create()
        result = tasks.create_article_html_renditions(article.pk)

        urls = [html.file.url for html in article.htmls.all()]

        self.assertEquals(sorted(result), sorted(urls))
Esempio n. 2
0
    def test_htmls_urls_are_returned(self):
        article = modelfactories.ArticleFactory.create()
        result = tasks.create_article_html_renditions(article.pk)

        urls = [html.file.url for html in article.htmls.all()]

        self.assertEquals(sorted(result), sorted(urls))
Esempio n. 3
0
    def test_htmls_filenames_are_suffixed_with_lang(self):
        article = modelfactories.ArticleFactory.create()
        result = tasks.create_article_html_renditions(article.pk)

        urls = [[html.file.url, html.lang] for html in article.htmls.all()]

        for url, lang in urls:
            self.assertTrue(url.endswith(u'-' + lang + u'.html'))
Esempio n. 4
0
    def test_htmls_filenames_are_suffixed_with_lang(self):
        article = modelfactories.ArticleFactory.create()
        result = tasks.create_article_html_renditions(article.pk)

        urls = [[html.file.url, html.lang] for html in article.htmls.all()]

        for url, lang in urls:
            self.assertTrue(url.endswith(u'-' + lang + u'.html'))
Esempio n. 5
0
 def test_unknown_article_raises_ValueError(self):
     self.assertRaises(ValueError,
             lambda: tasks.create_article_html_renditions(1))
Esempio n. 6
0
 def test_unknown_article_raises_ValueError(self):
     self.assertRaises(ValueError,
                       lambda: tasks.create_article_html_renditions(1))