test_app.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:SWEETer-Cat 作者: DanielAndreasen 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号