Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add missing media_root fixtures
Maciej Korycinski56fd8fa0a764
diff --git a/tests/conftest.py b/tests/conftest.pyindex a51c0cc34b..efb878e05e 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -264,7 +264,7 @@ def size_attribute(db): # pylint: disable=W0613@pytest.fixture-def image(media_root):+def image():img_data = BytesIO()image = Image.new('RGB', size=(1, 1))image.save(img_data, format='JPEG')@@ -277,7 +277,7 @@ def category(db): # pylint: disable=W0613@pytest.fixture-def category_with_image(db, image): # pylint: disable=W0613+def category_with_image(db, image, media_root): # pylint: disable=W0613return Category.objects.create(name='Default', slug='default', background_image=image)@@ -422,7 +422,7 @@ def order_list(customer_user):@pytest.fixture-def product_with_image(product, image):+def product_with_image(product, image, media_root):ProductImage.objects.create(product=product, image=image)return product@@ -718,7 +718,7 @@ def collection(db):@pytest.fixture-def collection_with_image(db, image):+def collection_with_image(db, image, media_root):collection = Collection.objects.create(name='Collection', slug='collection',description='Test description', background_image=image)diff --git a/tests/test_core.py b/tests/test_core.pyindex c9ff7c1ed6..bfdbba59ff 100644--- a/tests/test_core.py+++ b/tests/test_core.py@@ -112,7 +112,7 @@ def test_create_address(db):assert Address.objects.all().count() == 1-def test_create_fake_order(db, monkeypatch, image):+def test_create_fake_order(db, monkeypatch, image, media_root):# Tests shouldn't depend on images present in placeholder foldermonkeypatch.setattr('saleor.core.utils.random_data.get_image',