Repository: gouthambs/Flask-Blogging (language: python)

Issue:
ModuleNotFoundError: No module named 'werkzeug.contrib'  
Apparently some stuff was removed in werkzeug 1.0 so the build seems to break when running the example. I rolled back to a previous version (0.16.1) and everything started working again.


Remove Atom support. It is removed from Werkzeug. Fixes #141



Discussion / hints:
https://werkzeug.palletsprojects.com/en/1.0.x/changes/?highlight=atom

atom was deprecated during 0.15 and officially removed when 1.0 released. Maybe just update the requirements?
@mar1ad instead of completely ripping out ATOM, I am thinking we could use feedwerk to provide the functionality and still make it possible to upgrade. Take a look and let me know what you think: https://pypi.org/project/feedwerk/

A drop-in replacement :-)
Although I don't use the Atom support myself, it seems a no-brainer to try and keep it.

Fix patch:
diff --git a/Requirements.txt b/Requirements.txt
index 46a1e1f..d3d0311 100644
--- a/Requirements.txt
+++ b/Requirements.txt
@@ -6,7 +6,8 @@ flask-caching
 Flask-FileUpload
 SQLAlchemy>=1.3.1
 Markdown
-Werkzeug
+Werkzeug>=1.0.0
 blinker
 python-slugify
 shortuuid
+feedwerk
diff --git a/flask_blogging/views.py b/flask_blogging/views.py
index 5212186..fff159f 100644
--- a/flask_blogging/views.py
+++ b/flask_blogging/views.py
@@ -10,7 +10,7 @@
     url_for, flash, make_response
 from flask_blogging.forms import BlogEditor
 import math
-from werkzeug.contrib.atom import AtomFeed
+from feedwerk.atom import AtomFeed
 import datetime
 from flask_principal import PermissionDenied
 from .signals import page_by_id_fetched, page_by_id_processed, \


Test patch:
diff --git a/test/plugin.py b/test/plugin.py
index 41c343f..2259ccf 100644
--- a/test/plugin.py
+++ b/test/plugin.py
@@ -1,6 +1,6 @@
 from flask_blogging import signals, BloggingEngine
 from flask import Blueprint
-from werkzeug.contrib.atom import AtomFeed
+from feedwerk.atom import AtomFeed
 
 
 # receivers for various signals
diff --git a/test/test_views.py b/test/test_views.py
index 4748877..187f7c3 100644
--- a/test/test_views.py
+++ b/test/test_views.py
@@ -85,7 +85,7 @@ def test_index(self):
         self.assertEqual(response.status_code, 200)
 
         response = self.client.get("/blog")
-        self.assertEqual(response.status_code, 301)
+        self.assertIn(response.status_code, [301, 308])
 
         response = self.client.get("/blog/5/")
         self.assertEqual(response.status_code, 200)
@@ -102,7 +102,7 @@ def test_post_by_id(self):
         self.assertEqual(response.status_code, 200)
         # trailing slash redirect
         response = self.client.get("/blog/page/%s" % post_id0)
-        self.assertEqual(response.status_code, 301)
+        self.assertIn(response.status_code, [301, 308])
 
     def test_post_by_tag(self):
         response = self.client.get("/blog/tag/hello/")