Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add tests
fowczarek22fe1183e133
diff --git a/tests/api/test_core.py b/tests/api/test_core.pyindex d4a320c7c6..f04e7c1416 100644--- a/tests/api/test_core.py+++ b/tests/api/test_core.py@@ -4,6 +4,7 @@ import grapheneimport pytestfrom django.core.exceptions import ImproperlyConfiguredfrom django.utils import timezone+from graphql_jwt.shortcuts import get_tokenfrom saleor.graphql.core.enums import ReportingPeriodfrom saleor.graphql.core.mutations import BaseMutation@@ -219,3 +220,34 @@ def test_mutation_invalid_permission_in_meta(ImproperlyConfigured,message='Permissions should be a tuple or a string in Meta'):_run_test()+++MUTATION_TOKEN_VERIFY = """+ mutation tokenVerify($token: String!){+ tokenVerify(token: $token){+ user{+ }+ }+ }+"""+++def test_verify_token(api_client, customer_user):+ variables = {+ "token": get_token(customer_user)+ }+ response = api_client.post_graphql(MUTATION_TOKEN_VERIFY, variables)+ content = get_graphql_content(response)+ user_email = content['data']['tokenVerify']['user']['email']+ assert customer_user.email == user_email+++def test_verify_token_incorrect_token(api_client):+ variables = {+ "token": "incorrect_token"+ }+ response = api_client.post_graphql(MUTATION_TOKEN_VERIFY, variables)+ content = get_graphql_content(response)+ assert not content['data']['tokenVerify']+