1
0
Fork 0
forked from github/pelican

fix for issue #761: handle unicode correctly in summary for Markdown

This commit is contained in:
Deniz Turgut 2013-04-03 19:17:50 -04:00
commit 0548b62441
5 changed files with 39 additions and 7 deletions

View file

@ -0,0 +1,18 @@
Title: マックOS X 10.8でパイソンとVirtualenvをインストールと設定
Slug: python-virtualenv-on-mac-osx-mountain-lion-10.8
Date: 2012-12-20
Tags: パイソン, マック
Category: 指導書
Summary: パイソンとVirtualenvをまっくでインストールする方法について明確に説明します。
Writing unicode is certainly fun.
パイソンとVirtualenvをまっくでインストールする方法について明確に説明します。
And let's mix languages.
первый пост
Now another.
İlk yazı çok özel değil.

View file

@ -88,7 +88,8 @@ class TestArticlesGenerator(unittest.TestCase):
'article'],
['This is an article without category !', 'published',
'TestCategory', 'article'],
['This is a super article !', 'published', 'yeah', 'article']
['This is a super article !', 'published', 'yeah', 'article'],
['マックOS X 10.8でパイソンとVirtualenvをインストールと設定', 'published', '指導書', 'article']
]
self.assertItemsEqual(articles_expected, articles)
@ -97,7 +98,7 @@ class TestArticlesGenerator(unittest.TestCase):
generator = self.get_populated_generator()
categories = [cat.name for cat, _ in generator.categories]
categories_expected = ['Default', 'TestCategory', 'Yeah', 'test',
'yeah']
'yeah', '指導書']
self.assertEquals(categories, categories_expected)
def test_do_not_use_folder_as_category(self):
@ -114,7 +115,7 @@ class TestArticlesGenerator(unittest.TestCase):
generator.generate_context()
categories = [cat.name for cat, _ in generator.categories]
self.assertEquals(categories, ['Default', 'Yeah', 'test', 'yeah'])
self.assertEquals(categories, ['Default', 'Yeah', 'test', 'yeah', '指導書'])
def test_direct_templates_save_as_default(self):

View file

@ -131,6 +131,19 @@ class MdReaderTest(unittest.TestCase):
for key, value in metadata.items():
self.assertEquals(value, expected[key], key)
content, metadata = reader.read(
_path('article_with_markdown_and_nonascii_summary.md'))
expected = {
'title': 'マックOS X 10.8でパイソンとVirtualenvをインストールと設定',
'summary': '<p>パイソンとVirtualenvをまっくでインストールする方法について明確に説明します。</p>',
'category': '指導書',
'date': datetime.datetime(2012, 12, 20),
'tags': ['パイソン', 'マック'],
'slug': 'python-virtualenv-on-mac-osx-mountain-lion-10.8',
}
for key, value in metadata.items():
self.assertEquals(value, expected[key], key)
@unittest.skipUnless(readers.Markdown, "markdown isn't installed")
def test_article_with_file_extensions(self):
reader = readers.MarkdownReader({})