mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add test for parsed metadata
This commit is contained in:
parent
31dc9366f0
commit
3de422b1ab
1 changed files with 9 additions and 5 deletions
|
|
@ -319,17 +319,21 @@ class TestPage(LoggedTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
# also test for summary in metadata
|
# also test for summary in metadata
|
||||||
args['metadata']['summary'] = (
|
parsed = (
|
||||||
'A simple summary test, with a '
|
'A simple summary test, with a '
|
||||||
'<a href="|filename|article.rst">link</a>'
|
'<a href="|filename|article.rst">link</a>'
|
||||||
)
|
)
|
||||||
args['context']['localsiteurl'] = 'http://notmyidea.org'
|
linked = (
|
||||||
p = Page(**args)
|
|
||||||
self.assertEqual(
|
|
||||||
p.summary,
|
|
||||||
'A simple summary test, with a '
|
'A simple summary test, with a '
|
||||||
'<a href="http://notmyidea.org/article.html">link</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):
|
def test_intrasite_link_more(self):
|
||||||
# type does not take unicode in PY2 and bytes in PY3, which in
|
# type does not take unicode in PY2 and bytes in PY3, which in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue