Skip to content

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

Fix style

Krzysztof Wolski7fd5ef0022f6
diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.py
index 322af79fdb..2364ae0f76 100644
--- a/saleor/core/utils/random_data.py
+++ b/saleor/core/utils/random_data.py
@@ -52,8 +52,7 @@ def get_or_create_category(name, **kwargs):
def get_or_create_product_class(name, **kwargs):
- defaults = kwargs
- return ProductClass.objects.get_or_create(name=name, defaults=defaults)[0]
+ return ProductClass.objects.get_or_create(name=name, defaults=kwargs)[0]
def create_product(**kwargs):
diff --git a/tests/conftest.py b/tests/conftest.py
index c7d73d080c..6898b7ec19 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -10,9 +10,9 @@ from saleor.cart.models import Cart
from saleor.checkout.core import Checkout
from saleor.discount.models import Voucher
from saleor.order.models import Order
-from saleor.product.models import (Product, ProductVariant, Stock, ProductClass,
+from saleor.product.models import (Product, ProductVariant, ProductClass,
AttributeChoiceValue, ProductAttribute,
- StockLocation)
+ Stock, StockLocation)
from saleor.shipping.models import ShippingMethod
from saleor.userprofile.models import Address, User
@@ -107,7 +107,7 @@ def size_attribute(db): # pylint: disable=W0613
@pytest.fixture
-def product_class(db, color_attribute, size_attribute): # pylint: disable=W0613
+def product_class(color_attribute, size_attribute):
product_class = ProductClass.objects.create(name='Default Class',
has_variants=False)
product_class.product_attributes.add(color_attribute)
@@ -116,7 +116,7 @@ def product_class(db, color_attribute, size_attribute): # pylint: disable=W0613
@pytest.fixture
-def product_in_stock(db, product_class): # pylint: disable=W0613
+def product_in_stock(product_class):
product = Product.objects.create(
name='Test product', price=10, weight=1, product_class=product_class)
variant = ProductVariant.objects.create(product=product, sku='123')
diff --git a/tests/dashboard/test_product.py b/tests/dashboard/test_product.py
index e630d17477..c40dd9823d 100644
--- a/tests/dashboard/test_product.py
+++ b/tests/dashboard/test_product.py
@@ -4,7 +4,6 @@ from django.core.urlresolvers import reverse
import pytest
from saleor.dashboard.product.forms import ProductClassForm
-from saleor.product.models import ProductClass
@pytest.mark.integration
@@ -57,4 +56,3 @@ def test_variantless_product_class_form(color_attribute, size_attribute):
'has_variants': False}
form = ProductClassForm(data)
assert not form.is_valid()
-