File: fix_test_url.patch

package info (click to toggle)
flask-dance 6.2.0-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 976 kB
  • sloc: python: 6,185; makefile: 162
file content (59 lines) | stat: -rw-r--r-- 2,331 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Description: update URL for requests docs
Author: David Baumgold <david@davidbaumgold.com>
Origin: upstream
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1028877
Applied-Upstream: c961710fc73f591f8f9fec162c5e0b65ba9dc8a7
Last-Update: 2023-01-19
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/tests/consumer/storage/test_sqla.py
+++ b/tests/consumer/storage/test_sqla.py
@@ -64,7 +64,7 @@ def app(blueprint, db, request):
     app = flask.Flask(__name__)
     app.config["SQLALCHEMY_DATABASE_URI"] = os.environ.get("DATABASE_URI", "sqlite://")
     app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
-    app.config["CACHE_TYPE"] = "simple"
+    app.config["CACHE_TYPE"] = "SimpleCache"
     app.secret_key = "secret"
     app.register_blueprint(blueprint, url_prefix="/login")
     db.init_app(app)
--- a/tests/consumer/test_oauth2.py
+++ b/tests/consumer/test_oauth2.py
@@ -138,12 +138,11 @@ def test_authorized_url():
             == "https://a.b.c/login/test-service/authorized"
         )
         # check that we stored the access token in the session
-        with client.session_transaction() as sess:
-            assert sess["test-service_oauth_token"] == {
-                "access_token": "foobar",
-                "scope": ["admin"],
-                "token_type": "bearer",
-            }
+        assert flask.session["test-service_oauth_token"] == {
+            "access_token": "foobar",
+            "scope": ["admin"],
+            "token_type": "bearer",
+        }
 
 
 def test_authorized_url_no_state():
@@ -161,8 +160,7 @@ def test_authorized_url_no_state():
             "/login/test-service",
         )
         # check that there's nothing in the session
-        with client.session_transaction() as sess:
-            assert "test-service_oauth_token" not in sess
+        assert "test-service_oauth_token" not in flask.session
 
 
 @responses.activate
@@ -249,8 +247,7 @@ def test_authorized_url_token_lifetime()
             "expires_in": 300,
             "expires_at": 1451649901,
         }
-        with client.session_transaction() as sess:
-            assert sess["test-service_oauth_token"] == expected_stored_token
+        assert flask.session["test-service_oauth_token"] == expected_stored_token
 
 
 def test_return_expired_token(request):