def test_get_name_from_attributes_no_attributes(product_with_no_attributes): variant_without_attributes = product_with_no_attributes.variants.create( sku='example-sku') variant = variant_without_attributes attributes = variant.product.product_type.variant_attributes.all() name = get_name_from_attributes(variant, attributes) assert name == ''
def test_get_name_from_attributes(product): variant = product.variants.first() name = get_name_from_attributes(variant) assert name == 'Small'
def test_get_name_from_attributes(product): variant = product.variants.first() attributes = variant.product.product_type.variant_attributes.all() name = get_name_from_attributes(variant, attributes) assert name == 'Small'
def test_get_name_from_attributes(product): variant = product.variants.first() name = get_name_from_attributes(variant) assert name == 'Small'