Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove unnecessary fixture, remove legacy
Pacu2e536e3062010
diff --git a/saleor/settings.py b/saleor/settings.pyindex 503998282c..b4acba2dfe 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -310,18 +310,7 @@ VERSATILEIMAGEFIELD_RENDITION_KEY_SETS = {('product_small', 'crop__60x60'),('product_small_2x', 'crop__120x120'),('product_list', 'crop__255x255'),- ('product_list_2x', 'crop__510x510')],- 'category': [- ('background_image_small', 'crop__425x410'),- ('background_image_small_placeholder', 'crop__50x49'),- ('background_image_small2x', 'crop__850x820'),- ('background_image_medium', 'crop__768x303'),- ('background_image_medium_placeholder', 'crop__48x10'),- ('background_image_medium2x', 'crop__1536x606'),- ('background_image_large', 'crop__1440x303'),- ('background_image_large_placeholder', 'crop__50x20'),- ('background_image_large2x', 'crop__2880x606'),- ]}+ ('product_list_2x', 'crop__510x510')]}VERSATILEIMAGEFIELD_SETTINGS = {# Images should be pre-generated on Production environmentdiff --git a/tests/conftest.py b/tests/conftest.pyindex 9dc845e2bd..f181e79c01 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -56,12 +56,6 @@ def customer_user(db): # pylint: disable=W0613return User.objects.create_user('[email protected]', 'password')-def customer_client(client, customer_user):- client.login(username=customer_user.email, password='password')- return client--@pytest.fixturedef request_cart(cart, monkeypatch):# FIXME: Fixtures should not have any side effects@@ -99,8 +93,10 @@ def admin_user(db):@pytest.fixture()-def admin_client(client, admin_user):+def admin_client(admin_user):"""Return a Django test client logged in as an admin user."""+ from django.test.client import Client+ client = Client()client.login(username=admin_user.email, password='password')return clientdiff --git a/tests/test_collection.py b/tests/test_collection.pyindex c2d13ae8cb..09a1b95ee6 100644--- a/tests/test_collection.py+++ b/tests/test_collection.py@@ -3,20 +3,20 @@ from django.urls import reversefrom .utils import get_redirect_location-def test_collection_index(customer_client, collection):+def test_collection_index(client, collection):url_kwargs = {'pk': collection.id, 'slug': collection.slug}url = reverse('product:collection', kwargs=url_kwargs)- response = customer_client.get(url)+ response = client.get(url)assert response.status_code == 200-def test_collection_incorrect_slug(customer_client, collection):+def test_collection_incorrect_slug(client, collection):"""When entered on the collection with proper PK but incorrect slug,one should be permanently(301) redirected to the proper url."""url_kwargs = {'pk': collection.id, 'slug': 'incorrect-slug'}url = reverse('product:collection', kwargs=url_kwargs)- response = customer_client.get(url)+ response = client.get(url)# User should be redirected to the proper urlassert response.status_code == 301@@ -25,8 +25,8 @@ def test_collection_incorrect_slug(customer_client, collection):proper_url = reverse('product:collection', kwargs=proper_kwargs)assert redirected_url == proper_url-def test_collection_not_exists(customer_client):+def test_collection_not_exists(client):url_kwargs = {'pk': 123456, 'slug': 'incorrect-slug'}url = reverse('product:collection', kwargs=url_kwargs)- response = customer_client.get(url)+ response = client.get(url)assert response.status_code == 404