Skip to content

Commit

Permalink
Add test for parsed metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesfleche committed Feb 9, 2018
1 parent 31dc936 commit 3de422b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pelican/tests/test_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,21 @@ def test_intrasite_link(self):
)

# also test for summary in metadata
args['metadata']['summary'] = (
parsed = (
'A simple summary test, with a '
'<a href="|filename|article.rst">link</a>'
)
args['context']['localsiteurl'] = 'http://notmyidea.org'
p = Page(**args)
self.assertEqual(
p.summary,
linked = (
'A simple summary test, with a '
'<a href="http://notmyidea.org/article.html">link</a>'
)
args['settings']['FORMATTED_FIELDS'] = ['summary', 'custom']
args['metadata']['summary'] = parsed
args['metadata']['custom'] = parsed
args['context']['localsiteurl'] = 'http://notmyidea.org'
p = Page(**args)
self.assertEqual(p.summary, linked)
self.assertEqual(p.custom, linked)

def test_intrasite_link_more(self):
# type does not take unicode in PY2 and bytes in PY3, which in
Expand Down

0 comments on commit 3de422b

Please sign in to comment.