Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Mock missing test and fix wrong mock imports
NyanKiyoshia201b61e0da9
diff --git a/tests/api/test_account.py b/tests/api/test_account.pyindex 59185d9c1e..01399a4ec5 100644--- a/tests/api/test_account.py+++ b/tests/api/test_account.py@@ -27,7 +27,6 @@ from saleor.order.models import FulfillmentStatus, Orderfrom tests.api.utils import get_graphql_contentfrom tests.utils import create_image-from ..checks import customers as customer_checksfrom .utils import (assert_no_permission,convert_dict_keys_to_camel_case,@@ -782,8 +781,15 @@ def test_logged_customer_update_anonymus_user(api_client):assert_no_permission(response)+@patch(+ "saleor.graphql.account.utils.customer_events.staff_user_deleted_a_customer_event"+)def test_customer_delete(- staff_api_client, staff_user, customer_user, permission_manage_users+ mocked_deletion_event,+ staff_api_client,+ staff_user,+ customer_user,+ permission_manage_users,):"""Ensure deleting a customer actually deletes the customer and creates properrelated events"""@@ -813,7 +819,9 @@ def test_customer_delete(# Ensure the customer was properly deleted# and any related event was properly triggered- customer_checks.was_customer_properly_deleted(staff_user, customer_user)+ mocked_deletion_event.assert_called_once_with(+ staff_user=staff_user, deleted_count=1+ )def test_customer_delete_errors(customer_user, admin_user, staff_user):diff --git a/tests/api/test_bulk_delete.py b/tests/api/test_bulk_delete.pyindex 67664a91af..766c617360 100644--- a/tests/api/test_bulk_delete.py+++ b/tests/api/test_bulk_delete.py@@ -1,6 +1,7 @@+from unittest.mock import patch+import grapheneimport pytest-from mock import patchfrom saleor.account.models import Userfrom saleor.discount.models import Sale, Voucherdiff --git a/tests/dashboard/test_customer.py b/tests/dashboard/test_customer.pyindex f1c6b1983d..b37883bbcb 100644--- a/tests/dashboard/test_customer.py+++ b/tests/dashboard/test_customer.py@@ -1,4 +1,5 @@import json+from unittest.mock import patchfrom django.contrib.auth.tokens import default_token_generatorfrom django.core import mail@@ -6,7 +7,6 @@ from django.templatetags.static import staticfrom django.urls import reversefrom django.utils.encoding import force_bytesfrom django.utils.http import urlsafe_base64_encode-from mock import patchfrom templated_email import send_templated_mailfrom saleor.account.models import CustomerNote, User