Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix tests
Krzysztof Świątek7311a72a1ad7
diff --git a/saleor/account/utils.py b/saleor/account/utils.pyindex 67e6a059f6..681c0200e4 100644--- a/saleor/account/utils.py+++ b/saleor/account/utils.py@@ -1,10 +1,6 @@-import os-import random-import jwtfrom django.conf import settingsfrom django.core.exceptions import ValidationError-from django.core.files import Filefrom django.utils import timezonefrom ..account.error_codes import AccountErrorCodediff --git a/tests/api/test_account.py b/tests/api/test_account.pyindex 1245c78431..3947727243 100644--- a/tests/api/test_account.py+++ b/tests/api/test_account.py@@ -16,7 +16,7 @@ from prices import Moneyfrom saleor.account import events as account_eventsfrom saleor.account.error_codes import AccountErrorCodefrom saleor.account.models import Address, User-from saleor.account.utils import create_jwt_token, get_random_avatar+from saleor.account.utils import create_jwt_tokenfrom saleor.checkout import AddressTypefrom saleor.graphql.account.mutations.base import INVALID_TOKENfrom saleor.graphql.account.mutations.staff import (@@ -1537,11 +1537,6 @@ def test_staff_update_doesnt_change_existing_avatar(staff_user = User.objects.create(email="[email protected]", is_staff=True)- # Create random avatar- staff_user.avatar = get_random_avatar()- staff_user.save()- original_path = staff_user.avatar.path-id = graphene.Node.to_global_id("User", staff_user.id)variables = {"id": id, "permissions": [], "is_active": False}response = staff_api_client.post_graphql(@@ -1552,7 +1547,7 @@ def test_staff_update_doesnt_change_existing_avatar(assert data["errors"] == []staff_user.refresh_from_db()- assert staff_user.avatar.path == original_path+ assert not staff_user.avatardef test_staff_delete(staff_api_client, permission_manage_staff):diff --git a/tests/test_account.py b/tests/test_account.pyindex 53ed5486b4..a316611995 100644--- a/tests/test_account.py+++ b/tests/test_account.py@@ -1,10 +1,8 @@-import refrom urllib.parse import urlencodeimport i18naddressimport pytestfrom django.core.exceptions import ValidationError-from django.core.files import Filefrom django.http import QueryDictfrom django.template import Context, Templatefrom django_countries.fields import Country@@ -13,7 +11,7 @@ from saleor.account import forms, i18nfrom saleor.account.i18n import AddressFormfrom saleor.account.models import Userfrom saleor.account.templatetags.i18n_address_tags import format_address-from saleor.account.utils import get_random_avatar, remove_staff_member+from saleor.account.utils import remove_staff_memberfrom saleor.account.validators import validate_possible_number@@ -293,12 +291,6 @@ def test_get_full_name(email, first_name, last_name, full_name, address):assert user.get_full_name() == full_name-def test_get_random_avatar():- avatar = get_random_avatar()- assert isinstance(avatar, File)- assert re.match(r"avatar\d+.png", avatar.name)--def test_remove_staff_member_with_orders(staff_user, permission_manage_products, order):order.user = staff_userorder.save()diff --git a/tests/test_core.py b/tests/test_core.pyindex 13b4f2fbe3..2b23c174f8 100644--- a/tests/test_core.py+++ b/tests/test_core.py@@ -99,7 +99,7 @@ def test_create_superuser(db, client, media_root):assert User.objects.all().count() == 1admin = User.objects.all().first()assert admin.is_superuser- assert admin.avatar+ assert not admin.avatar# Test duplicatingcreate_superuser(credentials)assert User.objects.all().count() == 1