Skip to content

Commit

Permalink
fix: remove deprecated server_name argument
Browse files Browse the repository at this point in the history
  • Loading branch information
mblackgeo committed May 31, 2023
1 parent 9ff7f25 commit 22b10c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import pytest
from flask import Flask, make_response
from jwt import PyJWKSet

from flask_cognito_lib import CognitoAuth
from flask_cognito_lib.config import Config
from flask_cognito_lib.decorators import (
Expand All @@ -11,6 +9,7 @@
cognito_logout,
)
from flask_cognito_lib.utils import CognitoTokenResponse
from jwt import PyJWKSet


@pytest.fixture(autouse=True)
Expand Down Expand Up @@ -161,5 +160,5 @@ def token_response(mocker, access_token, id_token):
@pytest.fixture
def client_with_cookie(app, access_token, cfg):
cl = app.test_client()
cl.set_cookie(server_name="localhost", key=cfg.COOKIE_NAME, value=access_token)
cl.set_cookie(key=cfg.COOKIE_NAME, value=access_token)
yield cl
3 changes: 1 addition & 2 deletions tests/test_decorators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
from flask import session

from flask_cognito_lib.decorators import remove_from_session
from flask_cognito_lib.exceptions import TokenVerifyError

Expand Down Expand Up @@ -105,7 +104,7 @@ def test_cognito_logout(client, cfg):
def test_auth_required_expired_token(client, cfg, app, access_token):
# 403 if the token verification has failed
app.config["AWS_COGNITO_EXPIRATION_LEEWAY"] = 0
client.set_cookie(server_name="localhost", key=cfg.COOKIE_NAME, value=access_token)
client.set_cookie(key=cfg.COOKIE_NAME, value=access_token)
response = client.get("/private")
assert response.status_code == 403

Expand Down

0 comments on commit 22b10c8

Please sign in to comment.