Compare commits
No commits in common. "575e2ad387273aed3f13beddbe61de42490f4f1c" and "6dc443e59fe54119fa542af8b1cc249c0c7e68fa" have entirely different histories.
575e2ad387
...
6dc443e59f
@ -65,7 +65,4 @@ class Config(object):
|
||||
TITLE_SUFFIX = DOMAIN_NAME
|
||||
CONTACT_EMAIL = 'admin@example.com'
|
||||
|
||||
# feed settings
|
||||
AUTHOR = {'name': 'Test Name', 'email': 'admin@example.com'}
|
||||
|
||||
# specify FAVICON in your instance config.py to override the provided icon
|
||||
|
@ -32,9 +32,8 @@ def serve_feed(feed_type):
|
||||
abort(404)
|
||||
|
||||
fg = FeedGenerator()
|
||||
fg.id(f'https://{app.config["DOMAIN_NAME"]}/')
|
||||
fg.id(f'{app.config["DOMAIN_NAME"]}')
|
||||
fg.title(f'{app.config["TITLE_SUFFIX"]}')
|
||||
fg.author(app.config["AUTHOR"])
|
||||
fg.link(href=f'https://{app.config["DOMAIN_NAME"]}/feed/{feed_type}', rel='self')
|
||||
fg.link(href=f'https://{app.config["DOMAIN_NAME"]}', rel='alternate')
|
||||
fg.subtitle(f"Blog posts and other dated materials from {app.config['TITLE_SUFFIX']}")
|
||||
@ -56,7 +55,6 @@ def serve_feed(feed_type):
|
||||
fe = fg.add_entry()
|
||||
fe.id(_generate_feed_id(feed_entry_path))
|
||||
fe.title(page_name if page_name else page_title)
|
||||
fe.author(app.config["AUTHOR"])
|
||||
fe.link(href=link)
|
||||
fe.content(content, type='html')
|
||||
|
||||
|
@ -26,17 +26,7 @@ def test_rss_type_is_200(client):
|
||||
print(response.text)
|
||||
|
||||
|
||||
def test_feed_generator_atom(app):
|
||||
def test_feed_generator(app):
|
||||
"""Test the root feed generator."""
|
||||
with app.test_request_context():
|
||||
content = serve_feed('atom')
|
||||
assert b'<id>https://example.com/</id>' in content
|
||||
assert b'<email>admin@example.com</email>' in content
|
||||
assert b'<name>Test Name</name>' in content
|
||||
|
||||
|
||||
def test_feed_generator_rss(app):
|
||||
"""Test the root feed generator."""
|
||||
with app.test_request_context():
|
||||
content = serve_feed('rss')
|
||||
assert b'<author>admin@example.com (Test Name)</author>' in content
|
||||
serve_feed('atom')
|
||||
|
Loading…
x
Reference in New Issue
Block a user