Skip to content

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

Remove unused get_formfield_name method from Attribute

IKarbowiak3a8bfe89c993
diff --git a/saleor/product/models.py b/saleor/product/models.py
index 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.py
index 3ab45720bf..972bc4db38 100644
--- a/tests/test_product_attributes.py
+++ b/tests/test_product_attributes.py
@@ -5,13 +5,7 @@ from django.utils.text import slugify
from prices import Money
from saleor.product import AttributeInputType
-from saleor.product.models import (
- Attribute,
- AttributeValue,
- Product,
- ProductType,
- ProductVariant,
-)
+from saleor.product.models import AttributeValue, Product, ProductType, ProductVariant
from saleor.product.tasks import _update_variants_names
from 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 created
assert new_assignment.pk == old_assignment.pk
assert 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
- )