mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge branch 'master' of https://github.com/getpelican/pelican into davidmarble-page-order-by
This commit is contained in:
commit
e86f4d6250
3 changed files with 11 additions and 0 deletions
|
|
@ -145,6 +145,7 @@ class RstReader(BaseReader):
|
||||||
elif element.tagname == 'authors': # author list
|
elif element.tagname == 'authors': # author list
|
||||||
name = element.tagname
|
name = element.tagname
|
||||||
value = [element.astext() for element in element.children]
|
value = [element.astext() for element in element.children]
|
||||||
|
value = ','.join(value) # METADATA_PROCESSORS expects a string
|
||||||
else: # standard fields (e.g. address)
|
else: # standard fields (e.g. address)
|
||||||
name = element.tagname
|
name = element.tagname
|
||||||
value = element.astext()
|
value = element.astext()
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ class TestArticlesGenerator(unittest.TestCase):
|
||||||
['This is an article with category !', 'published', 'yeah',
|
['This is an article with category !', 'published', 'yeah',
|
||||||
'article'],
|
'article'],
|
||||||
['This is an article with multiple authors!', 'published', 'Default', 'article'],
|
['This is an article with multiple authors!', 'published', 'Default', 'article'],
|
||||||
|
['This is an article with multiple authors!', 'published', 'Default', 'article'],
|
||||||
['This is an article without category !', 'published', 'Default',
|
['This is an article without category !', 'published', 'Default',
|
||||||
'article'],
|
'article'],
|
||||||
['This is an article without category !', 'published',
|
['This is an article without category !', 'published',
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,15 @@ class RstReaderTest(ReaderTest):
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return unittest.skip('need the typogrify distribution')
|
return unittest.skip('need the typogrify distribution')
|
||||||
|
|
||||||
|
def test_article_with_multiple_authors(self):
|
||||||
|
page = self.read_file(path='article_with_multiple_authors.rst')
|
||||||
|
expected = {
|
||||||
|
'authors': ['First Author', 'Second Author']
|
||||||
|
}
|
||||||
|
|
||||||
|
for key, value in expected.items():
|
||||||
|
self.assertEqual(value, page.metadata[key], key)
|
||||||
|
|
||||||
|
|
||||||
class MdReaderTest(ReaderTest):
|
class MdReaderTest(ReaderTest):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue