Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Rename cart app to checkout
Anna Siwikf2f6a31ba258
diff --git a/saleor/account/views.py b/saleor/account/views.pyindex 6c222bb857..1bbdb346ba 100755--- a/saleor/account/views.py+++ b/saleor/account/views.py@@ -8,7 +8,7 @@ from django.template.response import TemplateResponsefrom django.urls import reverse, reverse_lazyfrom django.utils.translation import pgettext, ugettext_lazy as _-from ..cart.utils import find_and_assign_anonymous_cart+from ..checkout.utils import find_and_assign_anonymous_cartfrom ..core.utils import get_paginator_itemsfrom .forms import (ChangePasswordForm, LoginForm, PasswordResetForm, SignupForm,diff --git a/saleor/cart/__init__.py b/saleor/checkout/__init__.pysimilarity index 100%rename from saleor/cart/__init__.pyrename to saleor/checkout/__init__.pydiff --git a/saleor/cart/context_processors.py b/saleor/checkout/context_processors.pysimilarity index 100%rename from saleor/cart/context_processors.pyrename to saleor/checkout/context_processors.pydiff --git a/saleor/cart/forms.py b/saleor/checkout/forms.pysimilarity index 100%rename from saleor/cart/forms.pyrename to saleor/checkout/forms.pydiff --git a/saleor/cart/migrations/0001_auto_20170113_0435.py b/saleor/checkout/migrations/0001_auto_20170113_0435.pysimilarity index 83%rename from saleor/cart/migrations/0001_auto_20170113_0435.pyrename to saleor/checkout/migrations/0001_auto_20170113_0435.pyindex cfc9c7688a..4685670cb4 100644--- a/saleor/cart/migrations/0001_auto_20170113_0435.py+++ b/saleor/checkout/migrations/0001_auto_20170113_0435.py@@ -9,7 +9,11 @@ import jsonfield.fieldsclass Migration(migrations.Migration):dependencies = [- ('cart', 'fix_empty_data_in_lines'),+ ('checkout', 'fix_empty_data_in_lines'),+ ]++ replaces = [+ ('cart', '0001_auto_20170113_0435'),]operations = [diff --git a/saleor/cart/migrations/0001_initial.py b/saleor/checkout/migrations/0001_initial.pysimilarity index 92%rename from saleor/cart/migrations/0001_initial.pyrename to saleor/checkout/migrations/0001_initial.pyindex 74513ad4f6..6d001c57a4 100644--- a/saleor/cart/migrations/0001_initial.py+++ b/saleor/checkout/migrations/0001_initial.py@@ -18,6 +18,10 @@ class Migration(migrations.Migration):migrations.swappable_dependency(settings.AUTH_USER_MODEL),]+ replaces = [+ ('cart', '0001_initial'),+ ]+operations = [migrations.CreateModel(name='Cart',@@ -34,6 +38,7 @@ class Migration(migrations.Migration):('voucher', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to='discount.Voucher', null=True)),],options={+ 'db_table': 'cart_cart','ordering': ('-last_status_change',),},),@@ -43,9 +48,12 @@ class Migration(migrations.Migration):('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),('quantity', models.PositiveIntegerField(verbose_name='quantity', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(999)])),('data', models.TextField(default='{}', blank=True)),- ('cart', models.ForeignKey(related_name='lines', to='cart.Cart', on_delete=django.db.models.deletion.CASCADE)),+ ('cart', models.ForeignKey(related_name='lines', to='checkout.Cart', on_delete=django.db.models.deletion.CASCADE)),('product', models.ForeignKey(related_name='+', verbose_name='product', to='product.ProductVariant', on_delete=django.db.models.deletion.CASCADE)),],+ options={+ 'db_table': 'cart_cartline',+ },),migrations.AlterUniqueTogether(name='cartline',diff --git a/saleor/cart/migrations/0002_auto_20161014_1221.py b/saleor/checkout/migrations/0002_auto_20161014_1221.pysimilarity index 84%rename from saleor/cart/migrations/0002_auto_20161014_1221.pyrename to saleor/checkout/migrations/0002_auto_20161014_1221.pyindex edf752fee1..9ed241380f 100644--- a/saleor/cart/migrations/0002_auto_20161014_1221.py+++ b/saleor/checkout/migrations/0002_auto_20161014_1221.py@@ -9,7 +9,11 @@ class Migration(migrations.Migration):dependencies = [('product', '0012_auto_20160218_0812'),- ('cart', '0001_initial'),+ ('checkout', '0001_initial'),+ ]++ replaces = [+ ('cart', '0002_auto_20161014_1221'),]operations = [diff --git a/saleor/cart/migrations/0002_auto_20170206_0407.py b/saleor/checkout/migrations/0002_auto_20170206_0407.pysimilarity index 91%rename from saleor/cart/migrations/0002_auto_20170206_0407.pyrename to saleor/checkout/migrations/0002_auto_20170206_0407.pyindex 48e1f9f780..061c1d2930 100644--- a/saleor/cart/migrations/0002_auto_20170206_0407.py+++ b/saleor/checkout/migrations/0002_auto_20170206_0407.py@@ -11,7 +11,11 @@ import jsonfield.fieldsclass Migration(migrations.Migration):dependencies = [- ('cart', '0001_auto_20170113_0435'),+ ('checkout', '0001_auto_20170113_0435'),+ ]++ replaces = [+ ('cart', '0002_auto_20170206_0407'),]operations = [@@ -51,7 +55,7 @@ class Migration(migrations.Migration):migrations.AlterField(model_name='cartline',name='cart',- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lines', to='cart.Cart', verbose_name='cart'),+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lines', to='checkout.Cart', verbose_name='cart'),),migrations.AlterField(model_name='cartline',diff --git a/saleor/cart/migrations/0003_auto_20170906_0556.py b/saleor/checkout/migrations/0003_auto_20170906_0556.pysimilarity index 86%rename from saleor/cart/migrations/0003_auto_20170906_0556.pyrename to saleor/checkout/migrations/0003_auto_20170906_0556.pyindex eafccaae73..ce16d6fd78 100644--- a/saleor/cart/migrations/0003_auto_20170906_0556.py+++ b/saleor/checkout/migrations/0003_auto_20170906_0556.py@@ -8,7 +8,11 @@ from django.db import migrations, modelsclass Migration(migrations.Migration):dependencies = [- ('cart', '0002_auto_20170206_0407'),+ ('checkout', '0002_auto_20170206_0407'),+ ]++ replaces = [+ ('cart', '0003_auto_20170906_0556'),]operations = [diff --git a/saleor/cart/migrations/0004_auto_20171129_1004.py b/saleor/checkout/migrations/0004_auto_20171129_1004.pysimilarity index 80%rename from saleor/cart/migrations/0004_auto_20171129_1004.pyrename to saleor/checkout/migrations/0004_auto_20171129_1004.pyindex 8a71080148..919d5392a8 100644--- a/saleor/cart/migrations/0004_auto_20171129_1004.py+++ b/saleor/checkout/migrations/0004_auto_20171129_1004.py@@ -8,7 +8,11 @@ from django.db import migrationsclass Migration(migrations.Migration):dependencies = [- ('cart', '0003_auto_20170906_0556'),+ ('checkout', '0003_auto_20170906_0556'),+ ]++ replaces = [+ ('cart', '0004_auto_20171129_1004'),]operations = [diff --git a/saleor/cart/migrations/0005_auto_20180108_0814.py b/saleor/checkout/migrations/0005_auto_20180108_0814.pysimilarity index 95%rename from saleor/cart/migrations/0005_auto_20180108_0814.pyrename to saleor/checkout/migrations/0005_auto_20180108_0814.pyindex 548d4afd31..b4c581bcb3 100644--- a/saleor/cart/migrations/0005_auto_20180108_0814.py+++ b/saleor/checkout/migrations/0005_auto_20180108_0814.py@@ -15,7 +15,11 @@ import jsonfield.fieldsclass Migration(migrations.Migration):dependencies = [- ('cart', '0004_auto_20171129_1004'),+ ('checkout', '0004_auto_20171129_1004'),+ ]++ replaces = [+ ('cart', '0005_auto_20180108_0814'),]operations = [@@ -72,7 +76,7 @@ class Migration(migrations.Migration):migrations.AlterField(model_name='cartline',name='cart',- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lines', to='cart.Cart'),+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lines', to='checkout.Cart'),),migrations.AlterField(model_name='cartline',diff --git a/saleor/cart/migrations/0006_auto_20180221_0825.py b/saleor/checkout/migrations/0006_auto_20180221_0825.pysimilarity index 79%rename from saleor/cart/migrations/0006_auto_20180221_0825.pyrename to saleor/checkout/migrations/0006_auto_20180221_0825.pyindex ac4b2bca3f..5121c97ea1 100644--- a/saleor/cart/migrations/0006_auto_20180221_0825.py+++ b/saleor/checkout/migrations/0006_auto_20180221_0825.py@@ -6,7 +6,11 @@ from django.db import migrations, modelsclass Migration(migrations.Migration):dependencies = [- ('cart', '0005_auto_20180108_0814'),+ ('checkout', '0005_auto_20180108_0814'),+ ]++ replaces = [+ ('cart', '0006_auto_20180221_0825'),]operations = [diff --git a/saleor/cart/migrations/0007_merge_cart_with_checkout.py b/saleor/checkout/migrations/0007_merge_cart_with_checkout.pysimilarity index 88%rename from saleor/cart/migrations/0007_merge_cart_with_checkout.pyrename to saleor/checkout/migrations/0007_merge_cart_with_checkout.pyindex d970a65b5c..a74c0350a0 100644--- a/saleor/cart/migrations/0007_merge_cart_with_checkout.py+++ b/saleor/checkout/migrations/0007_merge_cart_with_checkout.py@@ -11,7 +11,11 @@ class Migration(migrations.Migration):('shipping', '0008_auto_20180108_0814'),('product', '0063_required_attr_value_order'),('account', '0018_auto_20180426_0641'),- ('cart', '0006_auto_20180221_0825'),+ ('checkout', '0006_auto_20180221_0825'),+ ]++ replaces = [+ ('cart', '0007_merge_cart_with_checkout.'),]operations = [@@ -67,4 +71,12 @@ class Migration(migrations.Migration):name='voucher_code',field=models.CharField(blank=True, max_length=12, null=True),),+ migrations.AlterModelTable(+ name='cart',+ table=None,+ ),+ migrations.AlterModelTable(+ name='cartline',+ table=None,+ ),]diff --git a/saleor/cart/migrations/__init__.py b/saleor/checkout/migrations/__init__.pysimilarity index 100%rename from saleor/cart/migrations/__init__.pyrename to saleor/checkout/migrations/__init__.pydiff --git a/saleor/cart/migrations/fix_empty_data_in_lines.py b/saleor/checkout/migrations/fix_empty_data_in_lines.pysimilarity index 77%rename from saleor/cart/migrations/fix_empty_data_in_lines.pyrename to saleor/checkout/migrations/fix_empty_data_in_lines.pyindex 26da4c6a76..eed49f4956 100644--- a/saleor/cart/migrations/fix_empty_data_in_lines.py+++ b/saleor/checkout/migrations/fix_empty_data_in_lines.py@@ -6,7 +6,7 @@ from django.db import migrationsdef convert_lines_data(apps, schema_editor):- CartLine = apps.get_model('cart', 'CartLine')+ CartLine = apps.get_model('checkout', 'CartLine')# Iterate over all cart lines, due to wrong JSONField None handlingfor line in CartLine.objects.all():if line.data is None:@@ -17,7 +17,11 @@ def convert_lines_data(apps, schema_editor):class Migration(migrations.Migration):dependencies = [- ('cart', '0002_auto_20161014_1221'),+ ('checkout', '0002_auto_20161014_1221'),+ ]++ replaces = [+ ('cart', 'fix_empty_data_in_lines'),]operations = [diff --git a/saleor/cart/models.py b/saleor/checkout/models.pysimilarity index 100%rename from saleor/cart/models.pyrename to saleor/checkout/models.pydiff --git a/saleor/cart/urls.py b/saleor/checkout/urls.pysimilarity index 93%rename from saleor/cart/urls.pyrename to saleor/checkout/urls.pyindex 31726f8d75..ffa5186666 100644--- a/saleor/cart/urls.py+++ b/saleor/checkout/urls.py@@ -1,15 +1,8 @@from django.conf.urls import urlfrom . import views-from saleor.cart.views.discount import remove_voucher_view+from .views.discount import remove_voucher_view-cart_urlpatterns = [- url(r'^$', views.cart_index, name='index'),- url(r'^update/(?P<variant_id>\d+)/$',- views.update_cart_line, name='update-line'),- url(r'^summary/$', views.cart_summary, name='summary'),- url(r'^shipping-options/$', views.cart_shipping_options,- name='shipping-options')]checkout_urlpatterns = [url(r'^$', views.checkout_index, name='index'),@@ -21,3 +14,12 @@ checkout_urlpatterns = [url(r'^remove_voucher/', remove_voucher_view,name='remove-voucher'),url(r'^login/', views.checkout_login, name='login')]+++cart_urlpatterns = [+ url(r'^$', views.cart_index, name='index'),+ url(r'^update/(?P<variant_id>\d+)/$',+ views.update_cart_line, name='update-line'),+ url(r'^summary/$', views.cart_summary, name='summary'),+ url(r'^shipping-options/$', views.cart_shipping_options,+ name='shipping-options')]diff --git a/saleor/cart/utils.py b/saleor/checkout/utils.pysimilarity index 99%rename from saleor/cart/utils.pyrename to saleor/checkout/utils.pyindex 6735c9a385..e1b020478b 100644--- a/saleor/cart/utils.py+++ b/saleor/checkout/utils.py@@ -14,9 +14,6 @@ from . import loggerfrom ..account.forms import get_address_formfrom ..account.models import Addressfrom ..account.utils import store_user_address-from ..cart.forms import (- AddressChoiceForm, AnonymousUserBillingForm, AnonymousUserShippingForm,- BillingAddressChoiceForm)from ..core.exceptions import InsufficientStockfrom ..core.utils import to_local_currencyfrom ..core.utils.taxes import ZERO_MONEY, get_taxes_for_country@@ -26,6 +23,9 @@ from ..discount.utils import (get_product_or_category_voucher_discount, get_shipping_voucher_discount,get_value_voucher_discount, increase_voucher_usage)from ..order.models import Order+from .forms import (+ AddressChoiceForm, AnonymousUserBillingForm, AnonymousUserShippingForm,+ BillingAddressChoiceForm)from .models import CartCOOKIE_NAME = 'cart'diff --git a/saleor/cart/views.py b/saleor/checkout/views.pysimilarity index 100%rename from saleor/cart/views.pyrename to saleor/checkout/views.pydiff --git a/saleor/cart/views/__init__.py b/saleor/checkout/views/__init__.pysimilarity index 100%rename from saleor/cart/views/__init__.pyrename to saleor/checkout/views/__init__.pydiff --git a/saleor/cart/views/discount.py b/saleor/checkout/views/discount.pysimilarity index 100%rename from saleor/cart/views/discount.pyrename to saleor/checkout/views/discount.pydiff --git a/saleor/cart/views/shipping.py b/saleor/checkout/views/shipping.pysimilarity index 100%rename from saleor/cart/views/shipping.pyrename to saleor/checkout/views/shipping.pydiff --git a/saleor/cart/views/summary.py b/saleor/checkout/views/summary.pysimilarity index 100%rename from saleor/cart/views/summary.pyrename to saleor/checkout/views/summary.pydiff --git a/saleor/cart/views/validators.py b/saleor/checkout/views/validators.pysimilarity index 100%rename from saleor/cart/views/validators.pyrename to saleor/checkout/views/validators.pydiff --git a/saleor/dashboard/order/forms.py b/saleor/dashboard/order/forms.pyindex e14f355652..e1f820b36e 100644--- a/saleor/dashboard/order/forms.py+++ b/saleor/dashboard/order/forms.py@@ -9,7 +9,7 @@ from payments import PaymentError, PaymentStatusfrom ...account.i18n import (AddressForm as StorefrontAddressForm, PossiblePhoneNumberFormField)from ...account.models import User-from ...cart.forms import QuantityField+from ...checkout.forms import QuantityFieldfrom ...core.exceptions import InsufficientStockfrom ...core.utils.taxes import ZERO_TAXED_MONEYfrom ...discount.models import Voucherdiff --git a/saleor/product/forms.py b/saleor/product/forms.pyindex 79fb0443e9..1574a3bad0 100644--- a/saleor/product/forms.py+++ b/saleor/product/forms.py@@ -5,7 +5,7 @@ from django.utils.encoding import smart_textfrom django.utils.translation import pgettext_lazyfrom django_prices.templatetags.prices_i18n import amount-from ..cart.forms import AddToCartForm+from ..checkout.forms import AddToCartFormfrom ..core.utils.taxes import display_gross_pricesdiff --git a/saleor/product/utils/__init__.py b/saleor/product/utils/__init__.pyindex 96dbfd57fd..91c52992fc 100644--- a/saleor/product/utils/__init__.py+++ b/saleor/product/utils/__init__.py@@ -4,7 +4,7 @@ from django.conf import settingsfrom django.contrib.auth.models import AnonymousUserfrom django.db.models import F-from ...cart.utils import (+from ...checkout.utils import (get_cart_from_request, get_or_create_cart_from_request)from ...core.utils import get_paginator_itemsfrom ...core.utils.filters import get_now_sorted_bydiff --git a/saleor/product/views.py b/saleor/product/views.pyindex 2d9c3d5896..38061bca9e 100644--- a/saleor/product/views.py+++ b/saleor/product/views.py@@ -6,7 +6,7 @@ from django.shortcuts import get_object_or_404, redirectfrom django.template.response import TemplateResponsefrom django.urls import reverse-from ..cart.utils import set_cart_cookie+from ..checkout.utils import set_cart_cookiefrom ..core.utils import serialize_decimalfrom ..seo.schema.product import product_json_ldfrom .filters import ProductCategoryFilter, ProductCollectionFilterdiff --git a/saleor/settings.py b/saleor/settings.pyindex 043aae5996..b0deb678b0 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -123,7 +123,7 @@ context_processors = ['django.contrib.messages.context_processors.messages','django.template.context_processors.request','saleor.core.context_processors.default_currency',- 'saleor.cart.context_processors.cart_counter',+ 'saleor.checkout.context_processors.cart_counter','saleor.core.context_processors.navigation','saleor.core.context_processors.search_enabled','saleor.site.context_processors.site',@@ -187,7 +187,7 @@ INSTALLED_APPS = ['saleor.account','saleor.discount','saleor.product',- 'saleor.cart',+ 'saleor.checkout','saleor.core','saleor.graphql','saleor.menu',diff --git a/saleor/urls.py b/saleor/urls.pyindex 37192dbfed..e597af2366 100644--- a/saleor/urls.py+++ b/saleor/urls.py@@ -8,8 +8,8 @@ from django.views.i18n import JavaScriptCatalog, set_languagefrom graphene_django.views import GraphQLViewfrom .account.urls import urlpatterns as account_urls-from .cart.urls import cart_urlpatterns as cart_urls-from .cart.urls import checkout_urlpatterns as checkout_urls+from .checkout.urls import cart_urlpatterns as cart_urls+from .checkout.urls import checkout_urlpatterns as checkout_urlsfrom .core.sitemaps import sitemapsfrom .core.urls import urlpatterns as core_urlsfrom .dashboard.urls import urlpatterns as dashboard_urlsdiff --git a/tests/conftest.py b/tests/conftest.pyindex e90e535154..bbfcef5112 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -15,9 +15,9 @@ from PIL import Imagefrom prices import Moneyfrom saleor.account.models import Address, User-from saleor.cart import utils-from saleor.cart.models import Cart-from saleor.cart.utils import add_variant_to_cart+from saleor.checkout import utils+from saleor.checkout.models import Cart+from saleor.checkout.utils import add_variant_to_cartfrom saleor.dashboard.order.utils import fulfill_order_linefrom saleor.discount.models import Sale, Voucherfrom saleor.menu.models import Menu, MenuItemdiff --git a/tests/test_cart.py b/tests/test_cart.pyindex a1f432513b..c8115ceb2e 100644--- a/tests/test_cart.py+++ b/tests/test_cart.py@@ -10,12 +10,12 @@ from django.http import HttpResponsefrom django.urls import reversefrom prices import Money, TaxedMoney-from saleor.cart import forms, utils-from saleor.cart.context_processors import cart_counter-from saleor.cart.models import Cart-from saleor.cart.utils import (+from saleor.checkout import forms, utils+from saleor.checkout.context_processors import cart_counter+from saleor.checkout.models import Cart+from saleor.checkout.utils import (add_variant_to_cart, change_cart_user, find_open_cart_for_user)-from saleor.cart.views import update_cart_line+from saleor.checkout.views import update_cart_linefrom saleor.core.exceptions import InsufficientStockfrom saleor.core.utils.taxes import ZERO_TAXED_MONEYfrom saleor.discount.models import Sale@@ -52,7 +52,7 @@ def user_cart(customer_user):def local_currency(monkeypatch):def side_effect(price, currency):return price- monkeypatch.setattr('saleor.cart.views.to_local_currency', side_effect)+ monkeypatch.setattr('saleor.checkout.views.to_local_currency', side_effect)def test_get_or_create_anonymous_cart_from_token(anonymous_cart, user_cart):@@ -124,9 +124,9 @@ def test_get_or_create_cart_from_request(mock_get_for_user = Mock(return_value=user_cart)mock_get_for_anonymous = Mock(return_value=anonymous_cart)monkeypatch.setattr(- 'saleor.cart.utils.get_or_create_user_cart', mock_get_for_user)+ 'saleor.checkout.utils.get_or_create_user_cart', mock_get_for_user)monkeypatch.setattr(- 'saleor.cart.utils.get_or_create_anonymous_cart_from_token',+ 'saleor.checkout.utils.get_or_create_anonymous_cart_from_token',mock_get_for_anonymous)returned_cart = utils.get_or_create_cart_from_request(request, queryset)mock_get_for_user.assert_called_once_with(customer_user, queryset)@@ -147,14 +147,14 @@ def test_get_cart_from_request(user_cart = Cart(user=customer_user)mock_get_for_user = Mock(return_value=user_cart)monkeypatch.setattr(- 'saleor.cart.utils.get_user_cart', mock_get_for_user)+ 'saleor.checkout.utils.get_user_cart', mock_get_for_user)returned_cart = utils.get_cart_from_request(request, queryset)mock_get_for_user.assert_called_once_with(customer_user, queryset)assert returned_cart == user_cartmock_get_for_user = Mock(return_value=None)monkeypatch.setattr(- 'saleor.cart.utils.get_user_cart', mock_get_for_user)+ 'saleor.checkout.utils.get_user_cart', mock_get_for_user)returned_cart = utils.get_cart_from_request(request, queryset)mock_get_for_user.assert_called_once_with(customer_user, queryset)assert not Cart.objects.filter(token=returned_cart.token).exists()@@ -162,7 +162,7 @@ def test_get_cart_from_request(anonymous_cart = Cart()mock_get_for_anonymous = Mock(return_value=anonymous_cart)monkeypatch.setattr(- 'saleor.cart.utils.get_anonymous_cart_from_token',+ 'saleor.checkout.utils.get_anonymous_cart_from_token',mock_get_for_anonymous)request = cart_request_factory(user=None, token=token)returned_cart = utils.get_cart_from_request(request, queryset)@@ -171,7 +171,7 @@ def test_get_cart_from_request(mock_get_for_anonymous = Mock(return_value=None)monkeypatch.setattr(- 'saleor.cart.utils.get_anonymous_cart_from_token',+ 'saleor.checkout.utils.get_anonymous_cart_from_token',mock_get_for_anonymous)returned_cart = utils.get_cart_from_request(request, queryset)assert not Cart.objects.filter(token=returned_cart.token).exists()@@ -281,7 +281,7 @@ def test_shipping_detection(cart, product):def test_cart_counter(monkeypatch):monkeypatch.setattr(- 'saleor.cart.context_processors.get_cart_from_request',+ 'saleor.checkout.context_processors.get_cart_from_request',Mock(return_value=Mock(quantity=4)))ret = cart_counter(Mock())assert ret == {'cart_counter': 4}@@ -323,17 +323,17 @@ def test_check_product_availability_and_warn(monkeypatch.setattr('django.contrib.messages.warning', Mock(warning=Mock()))monkeypatch.setattr(- 'saleor.cart.utils.contains_unavailable_variants',+ 'saleor.checkout.utils.contains_unavailable_variants',Mock(return_value=False))utils.check_product_availability_and_warn(MagicMock(), cart)assert len(cart) == 1monkeypatch.setattr(- 'saleor.cart.utils.contains_unavailable_variants',+ 'saleor.checkout.utils.contains_unavailable_variants',Mock(return_value=True))monkeypatch.setattr(- 'saleor.cart.utils.remove_unavailable_variants',+ 'saleor.checkout.utils.remove_unavailable_variants',lambda c: add_variant_to_cart(cart, variant, 0, replace=True))utils.check_product_availability_and_warn(MagicMock(), cart)diff --git a/tests/test_checkout.py b/tests/test_checkout.pyindex 68c4a7e6be..e83464d207 100644--- a/tests/test_checkout.py+++ b/tests/test_checkout.py@@ -8,9 +8,9 @@ from freezegun import freeze_timefrom prices import Money, TaxedMoneyfrom saleor.account.models import Address-from saleor.cart import views-from saleor.cart.forms import CartVoucherForm-from saleor.cart.utils import (+from saleor.checkout import views+from saleor.checkout.forms import CartVoucherForm+from saleor.checkout.utils import (add_variant_to_cart, change_billing_address_in_cart,change_shipping_address_in_cart, create_order, get_cart_data_for_checkout,get_taxes_for_cart, get_voucher_discount_for_cart, get_voucher_for_cart,@@ -35,7 +35,7 @@ def test_view_checkout_index(__len__=Mock(return_value=cart_length),is_shipping_required=Mock(return_value=is_shipping_required))monkeypatch.setattr(- 'saleor.cart.utils.get_cart_from_request', lambda req, qs: cart)+ 'saleor.checkout.utils.get_cart_from_request', lambda req, qs: cart)url = reverse('checkout:index')request = rf.get(url, follow=True)@@ -170,7 +170,7 @@ def test_view_checkout_shipping_method_without_address(assert get_redirect_location(response) == redirect_url-@patch('saleor.cart.views.summary.send_order_confirmation')+@patch('saleor.checkout.views.summary.send_order_confirmation')def test_view_checkout_summary(mock_send_confirmation, client, shipping_method, address,request_cart_with_item):@@ -195,7 +195,7 @@ def test_view_checkout_summary(mock_send_confirmation.delay.assert_called_once_with(order.pk)-@patch('saleor.cart.views.summary.send_order_confirmation')+@patch('saleor.checkout.views.summary.send_order_confirmation')def test_view_checkout_summary_authorized_user(mock_send_confirmation, authorized_client, customer_user,shipping_method, address, request_cart_with_item):@@ -221,7 +221,7 @@ def test_view_checkout_summary_authorized_user(mock_send_confirmation.delay.assert_called_once_with(order.pk)-@patch('saleor.cart.views.summary.send_order_confirmation')+@patch('saleor.checkout.views.summary.send_order_confirmation')def test_view_checkout_summary_save_language(mock_send_confirmation, authorized_client, customer_user,shipping_method, address, request_cart_with_item, settings):@@ -487,7 +487,7 @@ def test_get_discount_for_cart_shipping_voucher_not_applicable(def test_get_discount_for_cart_product_voucher_not_applicable(settings, monkeypatch):monkeypatch.setattr(- 'saleor.cart.utils.get_product_variants_and_prices',+ 'saleor.checkout.utils.get_product_variants_and_prices',lambda cart, product: [])voucher = Voucher(code='unique', type=VoucherType.PRODUCT,@@ -503,7 +503,7 @@ def test_get_discount_for_cart_product_voucher_not_applicable(def test_get_discount_for_cart_category_voucher_not_applicable(settings, monkeypatch):monkeypatch.setattr(- 'saleor.cart.utils.get_category_variants_and_prices',+ 'saleor.checkout.utils.get_category_variants_and_prices',lambda cart, product: [])voucher = Voucher(code='unique', type=VoucherType.CATEGORY,diff --git a/tests/test_discounts.py b/tests/test_discounts.pyindex 05b5f441eb..44c034a809 100644--- a/tests/test_discounts.py+++ b/tests/test_discounts.py@@ -4,7 +4,7 @@ from unittest.mock import Mockimport pytestfrom prices import Money, TaxedMoney-from saleor.cart.utils import get_voucher_discount_for_cart+from saleor.checkout.utils import get_voucher_discount_for_cartfrom saleor.discount import (DiscountValueType, VoucherApplyToProduct, VoucherType)from saleor.discount.models import NotApplicable, Sale, Voucher@@ -97,7 +97,7 @@ def test_products_voucher_checkout_discount_not(settings, monkeypatch, prices, discount_value, discount_type, apply_to,expected_value):monkeypatch.setattr(- 'saleor.cart.utils.get_product_variants_and_prices',+ 'saleor.checkout.utils.get_product_variants_and_prices',lambda cart, product: ((None, TaxedMoney(net=Money(price, 'USD'), gross=Money(price, 'USD')))diff --git a/tests/test_order.py b/tests/test_order.pyindex 95202cd962..61c2eb7231 100644--- a/tests/test_order.py+++ b/tests/test_order.py@@ -9,7 +9,7 @@ from prices import Money, TaxedMoneyfrom tests.utils import get_redirect_locationfrom saleor.account.models import User-from saleor.cart.utils import create_order+from saleor.checkout.utils import create_orderfrom saleor.core.utils.taxes import (DEFAULT_TAX_RATE_NAME, get_tax_rate_by_name, get_taxes_for_country)from saleor.order import FulfillmentStatus, OrderStatus, modelsdiff --git a/tests/test_product.py b/tests/test_product.pyindex fb671ef718..1bcf370b6e 100644--- a/tests/test_product.py+++ b/tests/test_product.py@@ -6,9 +6,9 @@ import pytestfrom django.urls import reversefrom prices import Money, TaxedMoney, TaxedMoneyRange-from saleor.cart import utils-from saleor.cart.models import Cart-from saleor.cart.utils import add_variant_to_cart+from saleor.checkout import utils+from saleor.checkout.models import Cart+from saleor.checkout.utils import add_variant_to_cartfrom saleor.discount.models import Salefrom saleor.product import ProductAvailabilityStatus, modelsfrom saleor.product.thumbnails import create_product_thumbnails