Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Merge cart and checkout URLs

Michał Jelonek2e02ecde2f93
diff --git a/saleor/checkout/urls.py b/saleor/checkout/urls.py
index 172a633b57..2fb670d4a1 100644
--- a/saleor/checkout/urls.py
+++ b/saleor/checkout/urls.py
@@ -5,21 +5,18 @@ from .views.discount import remove_voucher_view
checkout_urlpatterns = [
url(r'^$', views.checkout_index, name='index'),
+ url(r'^details/$', views.checkout_details, name='details'),
+ url(r'^update/(?P<variant_id>\d+)/$',
+ views.update_checkout_line, name='update-line'),
+ url(r'^clear/$', views.clear_checkout, name='clear'),
+ url(r'^shipping-options/$', views.checkout_shipping_options,
+ name='shipping-options'),
url(r'^shipping-address/', views.checkout_shipping_address,
name='shipping-address'),
url(r'^shipping-method/', views.checkout_shipping_method,
name='shipping-method'),
- url(r'^summary/', views.checkout_summary, name='summary'),
- url(r'^remove_voucher/', remove_voucher_view,
+ url(r'^order-summary/', views.checkout_order_summary, name='order-summary'),
+ url(r'^summary/$', views.cart_summary, name='summary'),
+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'^clear-cart/$', views.clear_cart, name='clear-cart'),
- url(r'^summary/$', views.cart_summary, name='summary'),
- url(r'^shipping-options/$', views.cart_shipping_options,
- name='shipping-options')]
diff --git a/saleor/checkout/views/__init__.py b/saleor/checkout/views/__init__.py
index f76ca9c447..997a639ebe 100644
--- a/saleor/checkout/views/__init__.py
+++ b/saleor/checkout/views/__init__.py
@@ -73,7 +73,7 @@ def checkout_shipping_method(request, checkout):
initial={'shipping_method': checkout.shipping_method})
if form.is_valid():
form.save()
- return redirect('checkout:summary')
+ return redirect('checkout:order-summary')
ctx = get_checkout_data_for_checkout(checkout, discounts, taxes)
ctx.update({'shipping_method_form': form})
@@ -84,7 +84,7 @@ def checkout_shipping_method(request, checkout):
@validate_voucher
@validate_checkout
@add_voucher_form
-def checkout_summary(request, checkout):
+def checkout_order_summary(request, checkout):
"""Display the correct order summary."""
if checkout.is_shipping_required():
view = validate_shipping_method(summary_with_shipping_view)
@@ -96,7 +96,7 @@ def checkout_summary(request, checkout):
@get_or_empty_db_checkout(checkout_queryset=Checkout.objects.for_display())
-def cart_index(request, checkout):
+def checkout_details(request, checkout):
"""Display checkout details."""
discounts = request.discounts
taxes = request.taxes
@@ -147,7 +147,7 @@ def cart_index(request, checkout):
@get_or_empty_db_checkout(checkout_queryset=Checkout.objects.for_display())
-def cart_shipping_options(request, checkout):
+def checkout_shipping_options(request, checkout):
"""Display shipping options to get a price estimate."""
country_form = CountryForm(request.POST or None, taxes=request.taxes)
if country_form.is_valid():
@@ -167,10 +167,10 @@ def cart_shipping_options(request, checkout):
@get_or_empty_db_checkout()
-def update_cart_line(request, checkout, variant_id):
+def update_checkout_line(request, checkout, variant_id):
"""Update the line quantities."""
if not request.is_ajax():
- return redirect('cart:index')
+ return redirect('checkout:details')
variant = get_object_or_404(ProductVariant, pk=variant_id)
discounts = request.discounts
taxes = request.taxes
@@ -205,10 +205,10 @@ def update_cart_line(request, checkout, variant_id):
@get_or_empty_db_checkout()
-def clear_cart(request, checkout):
+def clear_checkout(request, checkout):
"""Clear checkout."""
if not request.is_ajax():
- return redirect('cart:index')
+ return redirect('checkout:details')
checkout.lines.all().delete()
update_checkout_quantity(checkout)
response = {'numItems': 0}
diff --git a/saleor/checkout/views/discount.py b/saleor/checkout/views/discount.py
index b839ba6b03..784f01dd88 100644
--- a/saleor/checkout/views/discount.py
+++ b/saleor/checkout/views/discount.py
@@ -61,7 +61,7 @@ def validate_voucher(view):
'Checkout warning',
'This voucher has expired. Please review your checkout.')
messages.warning(request, msg)
- return redirect('checkout:summary')
+ return redirect('checkout:order-summary')
return view(request, checkout)
return func
diff --git a/saleor/checkout/views/summary.py b/saleor/checkout/views/summary.py
index 57488adac6..f1a318e3ca 100644
--- a/saleor/checkout/views/summary.py
+++ b/saleor/checkout/views/summary.py
@@ -31,12 +31,12 @@ def handle_order_placement(request, checkout):
discounts=request.discounts,
taxes=get_taxes_for_checkout(checkout, request.taxes))
except InsufficientStock:
- return redirect('cart:index')
+ return redirect('checkout:details')
except NotApplicable:
messages.warning(
request, pgettext(
'Checkout warning', 'Please review your checkout.'))
- return redirect('checkout:summary')
+ return redirect('checkout:order-summary')
# remove checkout after order is created
checkout.delete()
diff --git a/saleor/checkout/views/validators.py b/saleor/checkout/views/validators.py
index c983e0d799..e091552805 100644
--- a/saleor/checkout/views/validators.py
+++ b/saleor/checkout/views/validators.py
@@ -15,7 +15,7 @@ def validate_checkout(view):
def func(request, checkout):
if checkout:
return view(request, checkout)
- return redirect('cart:index')
+ return redirect('checkout:details')
return func
@@ -66,6 +66,6 @@ def validate_is_shipping_required(view):
@wraps(view)
def func(request, checkout):
if not checkout.is_shipping_required():
- return redirect('checkout:summary')
+ return redirect('checkout:order-summary')
return view(request, checkout)
return func
diff --git a/saleor/product/views.py b/saleor/product/views.py
index ac29587958..ba7bc8a30f 100644
--- a/saleor/product/views.py
+++ b/saleor/product/views.py
@@ -129,9 +129,9 @@ def product_add_to_checkout(request, slug, product_id):
form.save()
if request.is_ajax():
response = JsonResponse(
- {'next': reverse('cart:index')}, status=200)
+ {'next': reverse('checkout:details')}, status=200)
else:
- response = redirect('cart:index')
+ response = redirect('checkout:details')
else:
if request.is_ajax():
response = JsonResponse({'error': form.errors}, status=400)
diff --git a/saleor/urls.py b/saleor/urls.py
index d8b604c11d..8b247e524c 100644
--- a/saleor/urls.py
+++ b/saleor/urls.py
@@ -8,8 +8,7 @@ from django.views.decorators.csrf import csrf_exempt
from django.views.i18n import JavaScriptCatalog, set_language
from .account.urls import urlpatterns as account_urls
-from .checkout.urls import (
- cart_urlpatterns as cart_urls, checkout_urlpatterns as checkout_urls)
+from .checkout.urls import checkout_urlpatterns as checkout_urls
from .core.sitemaps import sitemaps
from .core.urls import urlpatterns as core_urls
from .dashboard.urls import urlpatterns as dashboard_urls
@@ -35,7 +34,6 @@ non_translatable_urlpatterns = [
translatable_urlpatterns = [
url(r'^', include(core_urls)),
- url(r'^cart/', include((cart_urls, 'cart'), namespace='cart')),
url(r'^checkout/',
include((checkout_urls, 'checkout'), namespace='checkout')),
url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
diff --git a/templates/base.html b/templates/base.html
index 2ed7eee265..7c3d12ae54 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -6,7 +6,7 @@
{% load static %}
{% load translate_url from urls %}
-<html lang="{{ LANGUAGE_CODE }}" class="no-js" data-shipping-options-url="{% url 'cart:shipping-options' %}" data-cart-summary-url="{% url 'cart:summary' %}">
+<html lang="{{ LANGUAGE_CODE }}" class="no-js" data-shipping-options-url="{% url 'checkout:shipping-options' %}" data-cart-summary-url="{% url 'checkout:summary' %}">
<head>
<title>{% block title %}{{ site.name }}{% endblock %}</title>
{% block meta %}
@@ -143,7 +143,7 @@
</div>
<div class="col-2 col-md-3">
<div class="navbar__brand__cart float-right">
- <a rel="nofollow" class="cart__icon" href="{% url "cart:index" %}">
+ <a rel="nofollow" class="cart__icon" href="{% url "checkout:details" %}">
<span class="cart-label d-none d-md-inline-block">
{% trans "Your Cart" context "Main navigation item" %}
</span>
@@ -204,7 +204,7 @@
</a>
<hr />
<li>
- <a rel="nofollow" href="{% url "cart:index" %}">
+ <a rel="nofollow" href="{% url "checkout:details" %}">
{% trans "Your Cart" context "Main navigation item" %}
</a>
</li>
diff --git a/templates/cart_dropdown.html b/templates/cart_dropdown.html
index 92f72d587c..0daf27a0ec 100644
--- a/templates/cart_dropdown.html
+++ b/templates/cart_dropdown.html
@@ -51,7 +51,7 @@
<div class="row cart-dropdown__actions">
<div class="col-md-1"></div>
<div class="col-md-5">
- <a href="{% url "cart:index" %}" class="btn secondary narrow float-md-right">{% trans "Go to cart" context "Checkout dropdown secondary action" %}</a>
+ <a href="{% url "checkout:details" %}" class="btn secondary narrow float-md-right">{% trans "Go to cart" context "Checkout dropdown secondary action" %}</a>
</div>
<div class="col-md-5">
<a href="{% url "checkout:login" %}" class="btn btn-primary narrow float-md-right">{% trans "Checkout" context "Cart dropdown primary action" %}</a>
diff --git a/templates/checkout/index.html b/templates/checkout/index.html
index bf9717ec1c..814eb9d733 100644
--- a/templates/checkout/index.html
+++ b/templates/checkout/index.html
@@ -9,7 +9,7 @@
{% block breadcrumb %}
<ul class="breadcrumbs list-unstyled">
<li><a href="{% url 'home' %}">{% trans "Home" context "Main navigation item" %}</a></li>
- <li><a rel="nofollow" href="{% url 'cart:index' %}">{% trans "Cart" context "Cart breadcrumb" %}</a></li>
+ <li><a rel="nofollow" href="{% url 'checkout:details' %}">{% trans "Cart" context "Cart breadcrumb" %}</a></li>
</ul>
{% endblock breadcrumb %}
@@ -51,7 +51,7 @@
<div class="col-5">
<div class="row">
<div class="cart__line__quantity col-md-7 col-12">
- <form role="form" action="{% url "cart:update-line" variant_id=line.variant.pk %}" method="post" class="form-cart">
+ <form role="form" action="{% url "checkout:update-line" variant_id=line.variant.pk %}" method="post" class="form-cart">
<div class="{% if form.quantity.errors %} has-error{% endif %}" tabindex="-1">
{{ line.form.quantity }}
</div>
@@ -80,7 +80,7 @@
<a href="{% url "checkout:login" %}" class="btn btn-primary float-right cart__submit">
{% trans "Checkout" context "Cart primary action" %}
</a>
- <button class="btn secondary float-right cart__clear" data-action="{% url 'cart:clear-cart' %}">
+ <button class="btn secondary float-right cart__clear" data-action="{% url 'checkout:clear' %}">
{% trans "Clear cart" context "cart page: secondary action, empty the cart" %}
</button>
</div>
diff --git a/tests/test_cart.py b/tests/test_cart.py
index fcd9e51995..17b1d67228 100644
--- a/tests/test_cart.py
+++ b/tests/test_cart.py
@@ -15,7 +15,7 @@ from saleor.checkout.context_processors import checkout_counter
from saleor.checkout.models import Checkout
from saleor.checkout.utils import (
add_variant_to_checkout, change_checkout_user, find_open_checkout_for_user)
-from saleor.checkout.views import clear_cart, update_cart_line
+from saleor.checkout.views import clear_checkout, update_checkout_line
from saleor.core.exceptions import InsufficientStock
from saleor.core.utils.taxes import ZERO_TAXED_MONEY
from saleor.discount.models import Sale
@@ -431,12 +431,12 @@ def test_replace_checkout_line_form_when_insufficient_stock(
def test_view_empty_checkout(client, request_checkout):
- response = client.get(reverse('cart:index'))
+ response = client.get(reverse('checkout:details'))
assert response.status_code == 200
def test_view_checkout_without_taxes(client, request_checkout_with_item):
- response = client.get(reverse('cart:index'))
+ response = client.get(reverse('checkout:details'))
response_checkout_line = response.context[0]['checkout_lines'][0]
checkout_line = request_checkout_with_item.lines.first()
assert not response_checkout_line['get_total'].tax.amount
@@ -447,7 +447,7 @@ def test_view_checkout_without_taxes(client, request_checkout_with_item):
def test_view_checkout_with_taxes(
settings, client, request_checkout_with_item, vatlayer):
settings.DEFAULT_COUNTRY = 'PL'
- response = client.get(reverse('cart:index'))
+ response = client.get(reverse('checkout:details'))
response_checkout_line = response.context[0]['checkout_lines'][0]
checkout_line = request_checkout_with_item.lines.first()
assert response_checkout_line['get_total'].tax.amount
@@ -460,7 +460,7 @@ def test_view_update_checkout_quantity(
client, local_currency, request_checkout_with_item):
variant = request_checkout_with_item.lines.get().variant
response = client.post(
- reverse('cart:update-line', kwargs={'variant_id': variant.pk}),
+ reverse('checkout:update-line', kwargs={'variant_id': variant.pk}),
data={'quantity': 3}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert response.status_code == 200
assert request_checkout_with_item.quantity == 3
@@ -470,7 +470,7 @@ def test_view_update_checkout_quantity_with_taxes(
client, local_currency, request_checkout_with_item, vatlayer):
variant = request_checkout_with_item.lines.get().variant
response = client.post(
- reverse('cart:update-line', kwargs={'variant_id': variant.id}),
+ reverse('checkout:update-line', kwargs={'variant_id': variant.id}),
{'quantity': 3}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert response.status_code == 200
assert request_checkout_with_item.quantity == 3
@@ -479,7 +479,7 @@ def test_view_update_checkout_quantity_with_taxes(
def test_view_invalid_update_checkout(client, request_checkout_with_item):
variant = request_checkout_with_item.lines.get().variant
response = client.post(
- reverse('cart:update-line', kwargs={'variant_id': variant.pk}),
+ reverse('checkout:update-line', kwargs={'variant_id': variant.pk}),
data={}, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
resp_decoded = json.loads(response.content.decode('utf-8'))
assert response.status_code == 400
@@ -490,7 +490,7 @@ def test_view_invalid_update_checkout(client, request_checkout_with_item):
def test_checkout_page_without_openexchagerates(
client, request_checkout_with_item, settings):
settings.OPENEXCHANGERATES_API_KEY = None
- response = client.get(reverse('cart:index'))
+ response = client.get(reverse('checkout:details'))
context = response.context
assert context['local_checkout_total'] is None
@@ -499,20 +499,20 @@ def test_checkout_page_with_openexchagerates(
client, monkeypatch, request_checkout_with_item, settings):
settings.DEFAULT_COUNTRY = 'PL'
settings.OPENEXCHANGERATES_API_KEY = 'fake-key'
- response = client.get(reverse('cart:index'))
+ response = client.get(reverse('checkout:details'))
context = response.context
assert context['local_checkout_total'] is None
monkeypatch.setattr(
'django_prices_openexchangerates.models.get_rates',
lambda c: {'PLN': Mock(rate=2)})
- response = client.get(reverse('cart:index'))
+ response = client.get(reverse('checkout:details'))
context = response.context
assert context['local_checkout_total'].currency == 'PLN'
def test_checkout_summary_page(settings, client, request_checkout_with_item, vatlayer):
settings.DEFAULT_COUNTRY = 'PL'
- response = client.get(reverse('cart:summary'))
+ response = client.get(reverse('checkout:summary'))
assert response.status_code == 200
content = response.context
assert content['quantity'] == request_checkout_with_item.quantity
@@ -526,7 +526,7 @@ def test_checkout_summary_page(settings, client, request_checkout_with_item, vat
def test_checkout_summary_page_empty_checkout(client, request_checkout):
- response = client.get(reverse('cart:summary'))
+ response = client.get(reverse('checkout:summary'))
assert response.status_code == 200
data = response.context
assert data['quantity'] == 0
@@ -606,7 +606,7 @@ def test_update_view_must_be_ajax(customer_user, rf):
request = rf.post(reverse('home'))
request.user = customer_user
request.discounts = None
- result = update_cart_line(request, 1)
+ result = update_checkout_line(request, 1)
assert result.status_code == 302
@@ -650,18 +650,18 @@ def test_checkout_taxes(request_checkout_with_item, shipping_zone, vatlayer):
assert checkout.get_subtotal(taxes=vatlayer) == taxed_price
-def test_clear_cart_must_be_ajax(rf, customer_user):
+def test_clear_checkout_must_be_ajax(rf, customer_user):
request = rf.post(reverse('home'))
request.user = customer_user
request.discounts = None
- response = clear_cart(request)
+ response = clear_checkout(request)
assert response.status_code == 302
-def test_clear_cart(request_checkout_with_item, client):
+def test_clear_checkout(request_checkout_with_item, client):
checkout = request_checkout_with_item
response = client.post(
- reverse('cart:clear-cart'), data={},
+ reverse('checkout:clear'), data={},
HTTP_X_REQUESTED_WITH='XMLHttpRequest')
assert response.status_code == 200
assert len(checkout.lines.all()) == 0
diff --git a/tests/test_checkout.py b/tests/test_checkout.py
index 55bfbae171..1b6d0b3f99 100644
--- a/tests/test_checkout.py
+++ b/tests/test_checkout.py
@@ -71,10 +71,10 @@ def test_clear_shipping_method(checkout, shipping_method):
@pytest.mark.parametrize('checkout_length, is_shipping_required, redirect_url', [
- (0, True, reverse('cart:index')),
- (0, False, reverse('cart:index')),
+ (0, True, reverse('checkout:details')),
+ (0, False, reverse('checkout:details')),
(1, True, reverse('checkout:shipping-address')),
- (1, False, reverse('checkout:summary'))])
+ (1, False, reverse('checkout:order-summary'))])
def test_view_checkout_index(
monkeypatch, rf, checkout_length, is_shipping_required, redirect_url):
checkout = Mock(
@@ -171,7 +171,7 @@ def test_view_checkout_shipping_address_without_shipping(
response = client.get(url)
assert response.status_code == 302
- assert get_redirect_location(response) == reverse('checkout:summary')
+ assert get_redirect_location(response) == reverse('checkout:order-summary')
assert not request_checkout.email
@@ -189,7 +189,7 @@ def test_view_checkout_shipping_method(
response = client.post(url, data, follow=True)
- redirect_url = reverse('checkout:summary')
+ redirect_url = reverse('checkout:order-summary')
assert response.request['PATH_INFO'] == redirect_url
@@ -209,7 +209,7 @@ def test_view_checkout_shipping_method_authorized_user(
response = authorized_client.post(url, data, follow=True)
- redirect_url = reverse('checkout:summary')
+ redirect_url = reverse('checkout:order-summary')
assert response.request['PATH_INFO'] == redirect_url
@@ -222,7 +222,7 @@ def test_view_checkout_shipping_method_without_shipping(
response = client.get(url)
assert response.status_code == 302
- assert get_redirect_location(response) == reverse('checkout:summary')
+ assert get_redirect_location(response) == reverse('checkout:order-summary')
def test_view_checkout_shipping_method_without_address(
@@ -245,7 +245,7 @@ def test_view_checkout_summary(
request_checkout_with_item.shipping_method = (
shipping_zone.shipping_methods.first())
request_checkout_with_item.save()
- url = reverse('checkout:summary')
+ url = reverse('checkout:order-summary')
data = {'address': 'shipping_address'}
response = client.get(url)
@@ -274,7 +274,7 @@ def test_view_checkout_summary_authorized_user(
request_checkout_with_item.shipping_method = (
shipping_zone.shipping_methods.first())
request_checkout_with_item.save()
- url = reverse('checkout:summary')
+ url = reverse('checkout:order-summary')
data = {'address': 'shipping_address'}
response = authorized_client.get(url)
@@ -308,7 +308,7 @@ def test_view_checkout_summary_save_language(
request_checkout_with_item.shipping_method = (
shipping_zone.shipping_methods.first())
request_checkout_with_item.save()
- url = reverse('checkout:summary')
+ url = reverse('checkout:order-summary')
data = {'address': 'shipping_address'}
response = authorized_client.get(url, HTTP_ACCEPT_LANGUAGE=user_language)
@@ -327,7 +327,7 @@ def test_view_checkout_summary_save_language(
def test_view_checkout_summary_without_address(request_checkout_with_item, client):
- url = reverse('checkout:summary')
+ url = reverse('checkout:order-summary')
response = client.get(url)
@@ -342,7 +342,7 @@ def test_view_checkout_summary_without_shipping_zone(
request_checkout_with_item.email = '[email protected]'
request_checkout_with_item.save()
- url = reverse('checkout:summary')
+ url = reverse('checkout:order-summary')
response = client.get(url)
assert response.status_code == 302
@@ -361,7 +361,7 @@ def test_view_checkout_summary_with_invalid_voucher(
shipping_zone.shipping_methods.first())
request_checkout_with_item.save()
- url = reverse('checkout:summary')
+ url = reverse('checkout:order-summary')
voucher_url = '{url}?next={url}'.format(url=url)
data = {'discount-voucher': voucher.code}
@@ -394,7 +394,7 @@ def test_view_checkout_summary_with_invalid_voucher_code(
shipping_zone.shipping_methods.first())
request_checkout_with_item.save()
- url = reverse('checkout:summary')
+ url = reverse('checkout:order-summary')
voucher_url = '{url}?next={url}'.format(url=url)
data = {'discount-voucher': 'invalid-code'}
@@ -426,7 +426,7 @@ def test_view_checkout_place_order_with_expired_voucher_code(
# save the checkout
checkout.save()
- checkout_url = reverse('checkout:summary')
+ checkout_url = reverse('checkout:order-summary')
# place order
data = {'address': 'shipping_address'}
@@ -457,8 +457,8 @@ def test_view_checkout_place_order_with_item_out_of_stock(
variant.quantity = 0
variant.save()
- checkout_url = reverse('checkout:summary')
- redirect_url = reverse('cart:index')
+ checkout_url = reverse('checkout:order-summary')
+ redirect_url = reverse('checkout:details')
# place order
data = {'address': 'shipping_address'}
@@ -482,7 +482,7 @@ def test_view_checkout_place_order_without_shipping_address(
# save the checkout
checkout.save()
- checkout_url = reverse('checkout:summary')
+ checkout_url = reverse('checkout:order-summary')
redirect_url = reverse('checkout:shipping-address')
# place order
@@ -502,7 +502,7 @@ def test_view_checkout_summary_remove_voucher(
shipping_zone.shipping_methods.first())
request_checkout_with_item.save()
- remove_voucher_url = reverse('checkout:summary')
+ remove_voucher_url = reverse('checkout:order-summary')
voucher_url = '{url}?next={url}'.format(url=remove_voucher_url)
data = {'discount-voucher': voucher.code}
diff --git a/tests/test_core.py b/tests/test_core.py
index 2b3ddf4c45..ef69014699 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -213,7 +213,7 @@ def test_set_language_redirects_to_current_endpoint(client):
user_language_point = 'en'
new_user_language = 'fr'
new_user_language_point = '/fr/'
- test_endpoint = 'cart:index'
+ test_endpoint = 'checkout:details'
# get a English translated url (.../en/...)
# and the expected url after we change it
@@ -244,7 +244,7 @@ def test_set_language_redirects_to_current_endpoint(client):
assert new_url != current_url
# now check if we got redirect the endpoint we wanted to go back
- # in the new language (cart:index)
+ # in the new language (checkout:details)
assert expected_url == new_url
diff --git a/tests/test_product.py b/tests/test_product.py
index 4516b526c3..71a2c8d99b 100644
--- a/tests/test_product.py
+++ b/tests/test_product.py
@@ -209,7 +209,7 @@ def test_adding_to_checkout_with_current_user_token(
request_checkout_with_item.user = customer_user
request_checkout_with_item.save()
- response = authorized_client.get(reverse('cart:index'))
+ response = authorized_client.get(reverse('checkout:details'))
utils.set_checkout_cookie(request_checkout_with_item, response)
authorized_client.cookies[key] = response.cookies[key]
@@ -233,7 +233,7 @@ def test_adding_to_checkout_with_another_user_token(
request_checkout_with_item.user = customer_user
request_checkout_with_item.save()
- response = client.get(reverse('cart:index'))
+ response = client.get(reverse('checkout:details'))
utils.set_checkout_cookie(request_checkout_with_item, response)
client.cookies[key] = response.cookies[key]
@@ -255,7 +255,7 @@ def test_anonymous_adding_to_checkout_with_another_user_token(
request_checkout_with_item.user = customer_user
request_checkout_with_item.save()
- response = client.get(reverse('cart:index'))
+ response = client.get(reverse('checkout:details'))
utils.set_checkout_cookie(request_checkout_with_item, response)
client.cookies[key] = response.cookies[key]
@@ -278,7 +278,7 @@ def test_adding_to_checkout_with_deleted_checkout_token(
request_checkout_with_item.save()
old_token = request_checkout_with_item.token
- response = authorized_client.get(reverse('cart:index'))
+ response = authorized_client.get(reverse('checkout:details'))
utils.set_checkout_cookie(request_checkout_with_item, response)
authorized_client.cookies[key] = response.cookies[key]
@@ -301,7 +301,7 @@ def test_adding_to_checkout_with_closed_checkout_token(
request_checkout_with_item.user = customer_user
request_checkout_with_item.save()
- response = authorized_client.get(reverse('cart:index'))
+ response = authorized_client.get(reverse('checkout:details'))
utils.set_checkout_cookie(request_checkout_with_item, response)
authorized_client.cookies[key] = response.cookies[key]
variant = product.variants.get()
diff --git a/tests/test_registration.py b/tests/test_registration.py
index 33662a4132..746e32c1de 100644
--- a/tests/test_registration.py
+++ b/tests/test_registration.py
@@ -40,21 +40,21 @@ def test_login_view_not_valid(client, customer_user):
def test_login_view_next(client, customer_user):
- url = reverse('account:login') + '?next=/cart/'
+ url = reverse('account:login') + '?next=/en/checkout/details/'
post_data = {'username': '[email protected]', 'password': 'password'}
response = client.post(url, post_data, follow=True)
redirect_location = response.request['PATH_INFO']
- assert redirect_location == reverse('cart:index')
+ assert redirect_location == reverse('checkout:details')
def test_login_view_redirect(client, customer_user):
url = reverse('account:login')
data = {
'username': '[email protected]', 'password': 'password',
- 'next': reverse('cart:index')}
+ 'next': reverse('checkout:details')}
response = client.post(url, data, follow=True)
redirect_location = response.request['PATH_INFO']
- assert redirect_location == reverse('cart:index')
+ assert redirect_location == reverse('checkout:details')
def test_logout_view_no_user(client):