Skip to content

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

Merge pull request #16877 from saleor/enable-return-lint-rules

Patryk Zawadzki5f2744758405
diff --cc saleor/tests/fixtures.py
index 7a03bddc73,1a7a0d37c0..1d29f6773b
--- a/saleor/tests/fixtures.py
+++ b/saleor/tests/fixtures.py
@@@ -1164,12 -1183,79 +1164,11 @@@ def user_checkout_with_items_for_cc(use
def user_checkouts(request, user_checkout_with_items, user_checkout_with_items_for_cc):
if request.param == "regular":
return user_checkout_with_items
- elif request.param == "click_and_collect":
+ if request.param == "click_and_collect":
return user_checkout_with_items_for_cc
- else:
- raise ValueError("Internal test error")
+ raise ValueError("Internal test error")
-def product_type_generator(
- attribute_generator, attribute_value_generator, default_tax_class
-):
- def create_product_type(
- name="Default Type",
- slug="default-type",
- kind=ProductTypeKind.NORMAL,
- has_variants=True,
- is_shipping_required=True,
- tax_class=default_tax_class,
- product_attributes=None,
- variant_attributes=None,
- ):
- product_type = ProductType.objects.create(
- name=name,
- slug=slug,
- kind=kind,
- has_variants=has_variants,
- is_shipping_required=is_shipping_required,
- tax_class=tax_class,
- )
- if product_attributes is None:
- product_attribute = attribute_generator(
- external_reference="colorAttributeExternalReference",
- slug="color",
- name="Color",
- type=AttributeType.PRODUCT_TYPE,
- filterable_in_storefront=True,
- filterable_in_dashboard=True,
- available_in_grid=True,
- )
-
- attribute_value_generator(
- external_reference="colorAttributeValue1ExternalReference",
- name="Red",
- slug="red",
- attribute=product_attribute,
- )
-
- product_attributes = [product_attribute]
- if variant_attributes is None:
- variant_attribute = attribute_generator(
- external_reference="sizeAttributeExternalReference",
- slug="size",
- name="Size",
- type=AttributeType.PRODUCT_TYPE,
- filterable_in_storefront=True,
- filterable_in_dashboard=True,
- available_in_grid=True,
- )
-
- attribute_value_generator(
- name="Small",
- slug="small",
- attribute=variant_attribute,
- )
- variant_attributes = [variant_attribute]
-
- product_type.product_attributes.add(*product_attributes)
- product_type.variant_attributes.add(
- *variant_attributes, through_defaults={"variant_selection": True}
- )
- return product_type
-
- return create_product_type
-
-
@pytest.fixture
def admin_user(db):
"""Return a Django admin user."""