From 8631a54514084879c9507fe7d0f89ae4464d84b5 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 8 Jan 2021 19:27:51 +0100 Subject: [PATCH] Fix test due to pyjwt2.0 --- freqtrade/rpc/api_server/api_auth.py | 2 +- tests/rpc/test_rpc_apiserver.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/rpc/api_server/api_auth.py b/freqtrade/rpc/api_server/api_auth.py index 110bb2a25..a39e31b85 100644 --- a/freqtrade/rpc/api_server/api_auth.py +++ b/freqtrade/rpc/api_server/api_auth.py @@ -44,7 +44,7 @@ def get_user_from_token(token, secret_key: str, token_type: str = "access"): return username -def create_token(data: dict, secret_key: str, token_type: str = "access") -> bytes: +def create_token(data: dict, secret_key: str, token_type: str = "access") -> str: to_encode = data.copy() if token_type == "access": expire = datetime.utcnow() + timedelta(minutes=15) diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index dfb0fb956..2212d4a79 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -93,7 +93,7 @@ def test_api_auth(): create_token({'identity': {'u': 'Freqtrade'}}, 'secret1234', token_type="NotATokenType") token = create_token({'identity': {'u': 'Freqtrade'}}, 'secret1234') - assert isinstance(token, bytes) + assert isinstance(token, str) u = get_user_from_token(token, 'secret1234') assert u == 'Freqtrade'