File 0001-tests-fix-compatibility-with-Flask-1.0.patch of Package python-Flask-Assets

From ea494b2f237990d95279bb34e46ba21e6155d92a Mon Sep 17 00:00:00 2001
From: Mia Herkt <mia@0x0.st>
Date: Sun, 21 Mar 2021 18:30:31 +0100
Subject: [PATCH] tests: fix compatibility with Flask >= 1.0

Flask.static_path has been removed in Flask 1.0.
See https://github.com/pallets/flask/issues/2385

Also, Flask.static_folder does not work as expected when the path
ends in a trailing slash.
See https://github.com/pallets/flask/issues/3452
---
 tests/test_integration.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/test_integration.py b/tests/test_integration.py
index d995e75..8adbdaa 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -28,11 +28,11 @@ class TestUrlAndDirectory(TempEnvironmentHelper):
     def setup(self):
         TempEnvironmentHelper.setup(self)
 
-        self.app = Flask(__name__, static_path='/app_static')
+        self.app = Flask(__name__, static_url_path='/app_static')
         from tests import test_module
         if not Blueprint:
             self.module = Module(test_module.__name__, name='module',
-                                 static_path='/mod_static')
+                                 static_url_path='/mod_static')
             self.app.register_module(self.module)
         else:
             self.blueprint = Blueprint('module', test_module.__name__,
@@ -65,8 +65,8 @@ class TestUrlAndDirectory(TempEnvironmentHelper):
         assert get_all_bundle_files(Bundle('./module/bar'), self.env) == [root + '/static/module/bar']
 
         # Custom static folder
-        self.app.static_folder = '/'
-        assert get_all_bundle_files(Bundle('foo'), self.env) == ['/foo']
+        self.app.static_folder = '/test'
+        assert get_all_bundle_files(Bundle('foo'), self.env) == ['/test/foo']
 
     def test_url_auto(self):
         """Test how urls are generated via the Flask static system
@@ -150,7 +150,7 @@ class TestUrlAndDirectoryWithInitApp(object):
     """
 
     def setup(self):
-        self.app = Flask(__name__, static_path='/initapp_static')
+        self.app = Flask(__name__, static_url_path='/initapp_static')
         self.env = Environment()
         self.env.init_app(self.app)
 
-- 
2.30.0

openSUSE Build Service is sponsored by