Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Use mock that comes with Python 3
Patryk Zawadzkia040c3abacdd
diff --git a/requirements.in b/requirements.inindex 74f6eceea7..5067d163cf 100644--- a/requirements.in+++ b/requirements.in@@ -33,7 +33,6 @@ jsonfield>=2.0.2Markdown>=2.4maxminddbmaxminddb-geolite2-mock>=1.3.0prices>=0.5.7psycopg2>=2.6purl>=0.4.1diff --git a/requirements.txt b/requirements.txtindex f42edf49d7..e23635ec97 100644--- a/requirements.txt+++ b/requirements.txt@@ -64,10 +64,8 @@ kombu==4.1.0 # via celerymarkdown==2.6.9maxminddb-geolite2==2017.803maxminddb==1.3.0-mock==2.0.0oauthlib==2.0.4 # via requests-oauthlib, social-auth-coreolefile==0.44 # via pillow-pbr==3.1.1 # via mockpdfrw==0.4 # via weasyprintphonenumberslite==8.8.5 # via django-phonenumber-fieldpillow==4.0.0 # via django-versatileimagefield@@ -93,7 +91,7 @@ requests==2.18.4s3transfer==0.1.10 # via boto3satchless==1.1.3singledispatch==3.4.0.3 # via graphene-django-six==1.11.0 # via cryptography, django-templated-email, elasticsearch-dsl, faker, freezegun, graphene, graphene-django, graphql-core, graphql-relay, html5lib, mock, promise, purl, python-dateutil, singledispatch, social-auth-app-django, social-auth-core, vcrpy+six==1.11.0 # via cryptography, django-templated-email, elasticsearch-dsl, faker, freezegun, graphene, graphene-django, graphql-core, graphql-relay, html5lib, promise, purl, python-dateutil, singledispatch, social-auth-app-django, social-auth-core, vcrpysocial-auth-app-django==2.0.0social-auth-core==1.4.0 # via social-auth-app-djangostripe==1.65.0 # via django-paymentsdiff --git a/tests/conftest.py b/tests/conftest.pyindex fb73e5b5be..2aeccb3462 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -1,5 +1,6 @@from decimal import Decimalfrom io import BytesIO+from unittest.mock import MagicMockimport pytestfrom django.contrib.auth.models import AnonymousUser, Group, Permission@@ -9,7 +10,6 @@ from django.core.files.uploadedfile import SimpleUploadedFilefrom django.utils.encoding import smart_textfrom PIL import Image-from mock import MagicMockfrom saleor.cart import utilsfrom saleor.cart.models import Cartfrom saleor.checkout.core import Checkoutdiff --git a/tests/test_asynchronous_tasks.py b/tests/test_asynchronous_tasks.pyindex 468cd11959..3de3914564 100644--- a/tests/test_asynchronous_tasks.py+++ b/tests/test_asynchronous_tasks.py@@ -1,26 +1,13 @@-import celery-import mockimport pytestfrom saleor.order.emails import (send_order_confirmation, send_payment_confirmation)[email protected]_task-def dummy_task(x):- return x+1---def test_task_running_asynchronously_on_worker(celery_worker):- assert dummy_task.delay(42).get(timeout=10) == 43--@pytest.mark.django_db@pytest.mark.integration[email protected]('saleor.order.emails.send_templated_mail')-def test_email_sending_asynchronously(email_send, transactional_db, celery_app,- celery_worker):+def test_email_sending_asynchronously(+ transactional_db, celery_app, celery_worker):order = send_order_confirmation.delay('[email protected]', '/nowhere/to/go')payment = send_payment_confirmation.delay('[email protected]', '/nowhere/')order.get()diff --git a/tests/test_cart.py b/tests/test_cart.pyindex fe9d2102e0..e6a1990a14 100644--- a/tests/test_cart.py+++ b/tests/test_cart.py@@ -1,5 +1,6 @@import jsonfrom uuid import uuid4+from unittest.mock import MagicMock, Mockfrom django.contrib.auth.models import AnonymousUserfrom django.core import signing@@ -7,7 +8,6 @@ from django.core.exceptions import ObjectDoesNotExistfrom django.http import HttpResponsefrom django.urls import reversefrom django_babel.templatetags.babel import currencyfmt-from mock import MagicMock, Mockfrom prices import Priceimport pytestfrom satchless.item import InsufficientStockdiff --git a/tests/test_checkout.py b/tests/test_checkout.pyindex e00736dd54..29c007933d 100644--- a/tests/test_checkout.py+++ b/tests/test_checkout.py@@ -1,6 +1,7 @@+from unittest.mock import MagicMock, Mock+from django.conf import settingsfrom django.contrib.auth.models import AnonymousUser-from mock import MagicMock, Mockfrom prices import Priceimport pytestfrom satchless.item import InsufficientStockdiff --git a/tests/test_core.py b/tests/test_core.pyindex 459d60efee..640baa2603 100644--- a/tests/test_core.py+++ b/tests/test_core.py@@ -1,4 +1,5 @@-from mock import Mock+from unittest.mock import Mock+import pytestfrom saleor.core.utils import (diff --git a/tests/test_data_feeds.py b/tests/test_data_feeds.pyindex cfddfccd73..94fb1fa7e7 100644--- a/tests/test_data_feeds.py+++ b/tests/test_data_feeds.py@@ -1,9 +1,9 @@import csvfrom io import StringIO+from unittest.mock import Mock, patchfrom django.contrib.sites.models import Sitefrom django.utils.encoding import smart_text-from mock import Mock, patchfrom saleor.data_feeds.google_merchant import (get_feed_items, item_attributes, item_google_product_category, write_feed)diff --git a/tests/test_discounts.py b/tests/test_discounts.pyindex 5c528d1a26..1932a03ffe 100644--- a/tests/test_discounts.py+++ b/tests/test_discounts.py@@ -1,10 +1,10 @@from datetime import date, datetime, timedeltafrom decimal import Decimal+from unittest.mock import Mock+import pytestfrom freezegun import freeze_time-from mock import Mockfrom prices import FixedDiscount, FractionalDiscount, Price-import pytestfrom saleor.cart.utils import get_category_variants_and_pricesfrom saleor.checkout.core import Checkoutdiff --git a/tests/test_emails.py b/tests/test_emails.pyindex 88a80bf8a8..29edee3387 100644--- a/tests/test_emails.py+++ b/tests/test_emails.py@@ -1,5 +1,6 @@+from unittest import mock+from django.conf import settings-import mockimport saleor.order.emails as emailsdiff --git a/tests/test_product.py b/tests/test_product.pyindex 875d6efd71..2535e40bfa 100644--- a/tests/test_product.py+++ b/tests/test_product.py@@ -1,10 +1,10 @@import datetimeimport json+from unittest.mock import Mock+import pytestfrom django.urls import reversefrom django.utils.encoding import smart_text-from mock import Mock-import pytestfrom tests.utils import filter_products_by_attributefrom saleor.cart import CartStatus, utilsdiff --git a/tests/test_product_tags.py b/tests/test_product_tags.pyindex 89e8bd9cdb..91458c5039 100644--- a/tests/test_product_tags.py+++ b/tests/test_product_tags.py@@ -1,5 +1,6 @@+from unittest.mock import Mock+from django.contrib.staticfiles.templatetags.staticfiles import static-from mock import Mockfrom saleor.product.templatetags.product_images import (choose_placeholder, get_thumbnail, product_first_image)