File: tests-Revert-upstream-modification-to-test_i18n.py.patch

package info (click to toggle)
flask-wtf 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 420 kB
  • sloc: python: 1,170; makefile: 21; sh: 10
file content (31 lines) | stat: -rw-r--r-- 889 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Carsten Schoenert <c.schoenert@t-online.de>
Date: Fri, 20 Jan 2023 20:11:24 +0100
Subject: tests: Revert upstream modification to test_i18n.py

Upstream uses functioninality from Flask-Babel 3.0.0 which will not be
part of bookworm.

Forwarded: Not-Needed
---
 tests/test_i18n.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/test_i18n.py b/tests/test_i18n.py
index c7956ec..5a2c3d9 100644
--- a/tests/test_i18n.py
+++ b/tests/test_i18n.py
@@ -32,11 +32,12 @@ def test_i18n(app, client):
     except ImportError:
         pytest.skip("Flask-Babel must be installed.")
 
+    babel = Babel(app)
+
+    @babel.localeselector
     def get_locale():
         return request.accept_languages.best_match(["en", "zh"], "en")
 
-    Babel(app, locale_selector=get_locale)
-
     @app.route("/", methods=["POST"])
     def index():
         form = NameForm()