def test_publication_links(publication_response, publication_data, category):
"""Test all the plublication adsabs links are present.
Test that links are inserted for the title and "read more" sections.
"""
for paper in publication_data[category]:
url = escape(paper["adsabs"])
read_more = '...<a href="{0}" target="_blank"> read more</a>'.format(url)
title_link = '<a href="{0}" target="_blank">{1}</a>'.format(url, paper["title"])
assert read_more.encode('utf-8') in publication_response.data
assert title_link.encode('utf-8') in publication_response.data
评论列表
文章目录