From 2bdbb27131d34bd3a73307f35fe110303af18c21 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Tue, 24 Dec 2024 10:45:18 +0100 Subject: [PATCH] python312Packages.flask-security: fix test Signed-off-by: Florian Brandes --- .../python-modules/flask-security/default.nix | 5 +++++ .../flask-security/fix_test_basic.patch | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/development/python-modules/flask-security/fix_test_basic.patch diff --git a/pkgs/development/python-modules/flask-security/default.nix b/pkgs/development/python-modules/flask-security/default.nix index 558880850878e..be4d066c86556 100644 --- a/pkgs/development/python-modules/flask-security/default.nix +++ b/pkgs/development/python-modules/flask-security/default.nix @@ -64,6 +64,11 @@ buildPythonPackage rec { hash = "sha256-RGRwgrDFe+0v8NYyajMikdoi1DQf1I+B5y8KJyF+cZs="; }; + patches = [ + # https://github.com/pallets-eco/flask-security/pull/1040 + ./fix_test_basic.patch + ]; + build-system = [ flit-core ]; # flask-login>=0.6.2 not satisfied by version 0.7.0.dev0 diff --git a/pkgs/development/python-modules/flask-security/fix_test_basic.patch b/pkgs/development/python-modules/flask-security/fix_test_basic.patch new file mode 100644 index 0000000000000..f7ecfd8e94332 --- /dev/null +++ b/pkgs/development/python-modules/flask-security/fix_test_basic.patch @@ -0,0 +1,13 @@ +diff --git a/tests/test_basic.py b/tests/test_basic.py +index d52be429..09dfa8e4 100644 +--- a/tests/test_basic.py ++++ b/tests/test_basic.py +@@ -157,6 +157,8 @@ def test_authenticate_with_subdomain_next(app, client, get_message): + + @pytest.mark.settings(subdomain="auth") + def test_authenticate_with_root_domain_next(app, client, get_message): ++ # As of Flask 3.1 this must be explicitly set. ++ app.subdomain_matching = True + app.config["SERVER_NAME"] = "lp.com" + app.config["SECURITY_REDIRECT_ALLOW_SUBDOMAINS"] = True + data = dict(email="matt@lp.com", password="password") \ No newline at end of file