Skip to content

Commit

Permalink
update test to reflect next_url in redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanhphan1147 committed Feb 6, 2024
1 parent a938ed4 commit 225423c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion flask_multipass_saml_groups/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import operator
from datetime import datetime, timedelta, timezone
from typing import Dict, Iterable, Optional, Type
from urllib.parse import urlsplit

from flask import current_app, redirect, request, session, url_for
from flask_multipass import (
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,11 @@ def test_redirect_to_login_if_session_expired(app, client):
with client.session_transaction() as sess:
sess[EXPIRY_SESSION_KEY] = dt_now - timedelta(seconds=1)

resp = client.get("/sample")
next_url = "/sample"
resp = client.get(next_url)
assert resp.status_code == 302
assert resp.location == url_for(app.config["MULTIPASS_LOGIN_ENDPOINT"])
assert url_for(app.config["MULTIPASS_LOGIN_ENDPOINT"]) in resp.location
assert next_url in resp.location


@freeze_time("Jan 14th, 2024")
Expand Down

0 comments on commit 225423c

Please sign in to comment.