From 2d941d21e131a4cd228b436706ded084d537b9c8 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Mon, 15 Mar 2021 23:24:44 +1100 Subject: Convert atom feeds to use feedgenerator library. Issue is that Werkzeug > 1.0.0 has removed werkzeug.contrib.atom.AtomFeed, making it difficult to use a distribution-packaged version of werkzeug. To solve this, I've replaced use of werkzeug.contrib.atom.AtomFeed with feedgenerator.Atom1Feed. After the change, the only major difference between the feeds before and after is that they use instead of . Minor differences include no longer adding 'type="text/html"' on some elements and no "xml:base" attribute on elements. I don't think these differences will have any noticable effect. Tested on Liferea feed reader. --- mediagoblin/tests/test_feed.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 mediagoblin/tests/test_feed.py (limited to 'mediagoblin/tests') diff --git a/mediagoblin/tests/test_feed.py b/mediagoblin/tests/test_feed.py new file mode 100644 index 00000000..93b8531f --- /dev/null +++ b/mediagoblin/tests/test_feed.py @@ -0,0 +1,19 @@ +from mediagoblin.tests.tools import fixture_add_user, fixture_media_entry + + +class TestFeeds: + def setup(self): + self.user = fixture_add_user(username='terence', privileges=['active']) + self.media_entry = fixture_media_entry( + uploader=self.user.id, + state='processed') + + def test_site_feed(self, test_app): + res = test_app.get('/atom/') + assert res.status_int == 200 + assert res.content_type == 'application/atom+xml' + + def test_user_feed(self, test_app): + res = test_app.get('/u/terence/atom/') + assert res.status_int == 200 + assert res.content_type == 'application/atom+xml' -- cgit v1.2.3