Пример #1
0
def test_author_create_rss(session):
    author = AuthorFactory()
    print(vars(author))
    entry = EntryFactory()
    author.entries.append(entry)
    author.create_rss("http://test.com/author/rss")
    rss = feedparser.parse(author.authorfeed.feed)

    assert rss.feed.title == u"{0}: {1}".format(author.name, app.config["PROJECT_NAME"])
    assert rss.entries[0].title == entry.title
    assert rss.entries[0].author is not None
    print(rss.entries[0].author)
    print(rss.entries[0].author_detail)
    assert rss.entries[0].author == str(author)
Пример #2
0
def test_author_create_rss_multiple_authors(session):
    author1 = AuthorFactory()
    author2 = AuthorFactory()
    entry = EntryFactory()
    entry.authors.append(author1)
    entry.authors.append(author2)
    entry.create_rss_author_string()

    author1.create_rss("http://test.com/author/rss")

    rss = feedparser.parse(author1.authorfeed.feed)

    assert rss.entries is not None
    assert len(rss.entries) == 1
    print(rss.entries[0].author)
    print(rss.entries[0].author_detail)
    assert rss.entries[0].author == entry.authorstring