Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Rename error msg to more readable. Confirm in tests that isValid is boolean value
Maciej Korycinski17abc379bb6d
diff --git a/saleor/graphql/account/mutations/jwt.py b/saleor/graphql/account/mutations/jwt.pyindex b39d208e7f..7bf45cd686 100644--- a/saleor/graphql/account/mutations/jwt.py+++ b/saleor/graphql/account/mutations/jwt.py@@ -43,7 +43,7 @@ def get_user(payload):user = get_user_from_payload(payload)if not user:raise ValidationError(- "token invalid", code=AccountErrorCode.JWT_INVALID_TOKEN.value+ "Invalid token", code=AccountErrorCode.JWT_INVALID_TOKEN.value)return userdiff --git a/saleor/graphql/account/tests/mutations/test_token_verify.py b/saleor/graphql/account/tests/mutations/test_token_verify.pyindex 09bf94aedc..e8ea4be256 100644--- a/saleor/graphql/account/tests/mutations/test_token_verify.py+++ b/saleor/graphql/account/tests/mutations/test_token_verify.py@@ -22,7 +22,7 @@ def test_verify_token(api_client, customer_user):response = api_client.post_graphql(MUTATION_TOKEN_VERIFY, variables)content = get_graphql_content(response)data = content["data"]["tokenVerify"]- assert data["isValid"]+ assert data["isValid"] is Trueuser_email = content["data"]["tokenVerify"]["user"]["email"]assert customer_user.email == user_email@@ -35,7 +35,7 @@ def test_verify_token_incorrect_token(api_client):errors = data["accountErrors"]assert len(errors) == 1assert errors[0]["code"] == AccountErrorCode.JWT_DECODE_ERROR.name- assert not data["isValid"]+ assert data["isValid"] is Falseassert not data["user"]