def test_generate_name_from_values():
    attribute = Attribute.objects.create(slug="color", name="Color")
    red = AttributeValue.objects.create(attribute=attribute, name="Red", slug="red")
    blue = AttributeValue.objects.create(attribute=attribute, name="Blue", slug="blue")
    yellow = AttributeValue.objects.create(
        attribute=attribute, name="Yellow", slug="yellow"
    )
    values = {"3": red, "2": blue, "1": yellow}
    name = generate_name_from_values(values)
    assert name == "Yellow / Blue / Red"
def test_generate_name_from_values():
    attribute = ProductAttribute.objects.create(
        slug='color', name='Color')
    red = AttributeChoiceValue.objects.create(
        attribute=attribute, name='Red', slug='red')
    blue = AttributeChoiceValue.objects.create(
        attribute=attribute, name='Blue', slug='blue')
    yellow = AttributeChoiceValue.objects.create(
        attribute=attribute, name='Yellow', slug='yellow')
    values = {'3': red, '2': blue, '1': yellow}
    name = generate_name_from_values(values)
    assert name == 'Yellow / Blue / Red'
def test_generate_name_from_values():
    attribute = Attribute.objects.create(
        slug='color', name='Color')
    red = AttributeValue.objects.create(
        attribute=attribute, name='Red', slug='red')
    blue = AttributeValue.objects.create(
        attribute=attribute, name='Blue', slug='blue')
    yellow = AttributeValue.objects.create(
        attribute=attribute, name='Yellow', slug='yellow')
    values = {'3': red, '2': blue, '1': yellow}
    name = generate_name_from_values(values)
    assert name == 'Yellow / Blue / Red'
def test_generate_name_from_values():
    attribute = Attribute.objects.create(slug="color", name="Color")
    red = AttributeValue.objects.create(attribute=attribute,
                                        name="Red",
                                        slug="red")
    blue = AttributeValue.objects.create(attribute=attribute,
                                         name="Blue",
                                         slug="blue")
    yellow = AttributeValue.objects.create(attribute=attribute,
                                           name="Yellow",
                                           slug="yellow")
    values = {"3": red, "2": blue, "1": yellow}
    name = generate_name_from_values(values)
    assert name == "Yellow / Blue / Red"
def test_generate_name_from_values_empty():
    name = generate_name_from_values({})
    assert name == ''
def test_generate_name_from_values_empty():
    name = generate_name_from_values({})
    assert name == ''