Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove unused get_formfield_name method from Attribute
IKarbowiak3a8bfe89c993
diff --git a/saleor/product/models.py b/saleor/product/models.pyindex f0b2424696..b4e438a094 100644--- a/saleor/product/models.py+++ b/saleor/product/models.py@@ -758,9 +758,6 @@ class Attribute(ModelWithMetadata):def __str__(self) -> str:return self.name- def get_formfield_name(self) -> str:- return slugify("attribute-%s-%s" % (self.slug, self.pk), allow_unicode=True)-def has_values(self) -> bool:return self.values.exists()diff --git a/tests/test_product_attributes.py b/tests/test_product_attributes.pyindex 3ab45720bf..972bc4db38 100644--- a/tests/test_product_attributes.py+++ b/tests/test_product_attributes.py@@ -5,13 +5,7 @@ from django.utils.text import slugifyfrom prices import Moneyfrom saleor.product import AttributeInputType-from saleor.product.models import (- Attribute,- AttributeValue,- Product,- ProductType,- ProductVariant,-)+from saleor.product.models import AttributeValue, Product, ProductType, ProductVariantfrom saleor.product.tasks import _update_variants_namesfrom saleor.product.utils.attributes import (associate_attribute_values_to_instance,@@ -149,10 +143,3 @@ def test_associate_attribute_to_product_instance_without_values(product):# Ensure the values were cleared and no new assignment entry was createdassert new_assignment.pk == old_assignment.pkassert new_assignment.values.count() == 0---def test_get_formfield_name_with_unicode_characters(db):- text_attribute = Attribute.objects.create(slug="ąęαβδηθλμπ", name="ąęαβδηθλμπ")- assert text_attribute.get_formfield_name() == "attribute-ąęαβδηθλμπ-{}".format(- text_attribute.pk- )