Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add test
Krzysztof Świąteke9b450523dac
diff --git a/tests/api/test_account.py b/tests/api/test_account.pyindex c8634abf88..96c67c9de6 100644--- a/tests/api/test_account.py+++ b/tests/api/test_account.py@@ -10,6 +10,7 @@ from django.core.exceptions import ValidationErrorfrom django.core.files import Filefrom django.core.validators import URLValidatorfrom django.test import override_settings+from django.utils import timezonefrom freezegun import freeze_timefrom prices import Money@@ -89,10 +90,14 @@ def test_create_token_mutation(api_client, staff_user, settings):}"""variables = {"email": staff_user.email, "password": "password"}- response = api_client.post_graphql(query, variables)+ time = timezone.now()+ with freeze_time(time):+ response = api_client.post_graphql(query, variables)content = get_graphql_content(response)token_data = content["data"]["tokenCreate"]token = jwt.decode(token_data["token"], settings.SECRET_KEY)+ staff_user.refresh_from_db()+ assert staff_user.last_login == timeassert token["email"] == staff_user.emailassert token["user_id"] == graphene.Node.to_global_id("User", staff_user.id)