Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Change name of fixture
Maciek Jabłoński03bbcb922007
diff --git a/tests/conftest.py b/tests/conftest.pyindex 818c6fa566..094399d38b 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -16,11 +16,8 @@ def cart(db): # pylint: disable=W0613@pytest.fixture-def cart_with_item(product_in_stock, request_cart):- variant = product_in_stock.variants.get()- # Prepare some data- request_cart.add(variant)- return request_cart+def normal_user(db):+ return User.objects.create_user('[email protected]', 'password')@pytest.fixture@@ -32,8 +29,11 @@ def request_cart(cart, monkeypatch):@pytest.fixture-def normal_user(db):- return User.objects.create_user('[email protected]', 'password')+def request_cart_with_item(product_in_stock, request_cart):+ variant = product_in_stock.variants.get()+ # Prepare some data+ request_cart.add(variant)+ return request_cart@pytest.fixture()diff --git a/tests/test_checkout_integration.py b/tests/test_checkout_integration.pyindex e1b0d0f4bb..5a37887b1b 100644--- a/tests/test_checkout_integration.py+++ b/tests/test_checkout_integration.py@@ -3,7 +3,7 @@ from django.core.urlresolvers import reversefrom tests.utils import get_redirect_location-def test_checkout_flow(cart_with_item, client, shipping_method): # pylint: disable=W0613+def test_checkout_flow(request_cart_with_item, client, shipping_method): # pylint: disable=W0613"""Basic test case that confirms if core checkout flow works"""@@ -62,15 +62,15 @@ def test_checkout_flow(cart_with_item, client, shipping_method): # pylint: disaassert get_redirect_location(payment_response) == order_details-def test_checkout_flow_authenticated_user(authorized_client, billing_address, cart_with_item,+def test_checkout_flow_authenticated_user(authorized_client, billing_address, request_cart_with_item,normal_user, shipping_method):"""Checkout with authenticated user and previously saved address"""# Prepare some datanormal_user.addresses.add(billing_address)- cart_with_item.user = normal_user- cart_with_item.save()+ request_cart_with_item.user = normal_user+ request_cart_with_item.save()# Enter checkout# Checkout index redirects directly to shipping address step@@ -112,7 +112,7 @@ def test_checkout_flow_authenticated_user(authorized_client, billing_address, caassert get_redirect_location(payment_response) == order_details-def test_address_without_shipping(cart_with_item, client, monkeypatch): # pylint: disable=W0613+def test_address_without_shipping(request_cart_with_item, client, monkeypatch): # pylint: disable=W0613"""user tries to get shipping address step in checkout without shipping -if is redirected to summary step@@ -126,7 +126,7 @@ def test_address_without_shipping(cart_with_item, client, monkeypatch): # pylinassert get_redirect_location(response) == reverse('checkout:summary')-def test_shipping_method_without_shipping(cart_with_item, client, monkeypatch): # pylint: disable=W0613+def test_shipping_method_without_shipping(request_cart_with_item, client, monkeypatch): # pylint: disable=W0613"""user tries to get shipping method step in checkout without shipping -if is redirected to summary step@@ -140,7 +140,7 @@ def test_shipping_method_without_shipping(cart_with_item, client, monkeypatch):assert get_redirect_location(response) == reverse('checkout:summary')-def test_shipping_method_without_address(cart_with_item, client): # pylint: disable=W0613+def test_shipping_method_without_address(request_cart_with_item, client): # pylint: disable=W0613"""user tries to get shipping method step without saved shipping address -if is redirected to shipping address step@@ -151,7 +151,7 @@ def test_shipping_method_without_address(cart_with_item, client): # pylint: disassert get_redirect_location(response) == reverse('checkout:shipping-address')-def test_summary_without_address(cart_with_item, client): # pylint: disable=W0613+def test_summary_without_address(request_cart_with_item, client): # pylint: disable=W0613"""user tries to get summary step without saved shipping method -if is redirected to shipping method step@@ -162,7 +162,7 @@ def test_summary_without_address(cart_with_item, client): # pylint: disable=W06assert get_redirect_location(response) == reverse('checkout:shipping-method')-def test_summary_without_shipping_method(cart_with_item, client, monkeypatch): # pylint: disable=W0613+def test_summary_without_shipping_method(request_cart_with_item, client, monkeypatch): # pylint: disable=W0613"""user tries to get summary step without saved shipping method -if is redirected to shipping method step@@ -176,7 +176,7 @@ def test_summary_without_shipping_method(cart_with_item, client, monkeypatch):assert get_redirect_location(response) == reverse('checkout:shipping-method')-def test_client_login(cart_with_item, client, admin_user):+def test_client_login(request_cart_with_item, client, admin_user):data = {'username': admin_user.email,'password': 'password'@@ -185,4 +185,4 @@ def test_client_login(cart_with_item, client, admin_user):assert response.status_code == 302assert get_redirect_location(response) == '/'response = client.get(reverse('checkout:shipping-address'))- assert response.context['checkout'].cart.token == cart_with_item.token+ assert response.context['checkout'].cart.token == request_cart_with_item.token