Skip to content

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

Add category formatter test

Krzysztof Wolskida1854fb1204
diff --git a/tests/test_integrations.py b/tests/test_integrations.py
index 44d71e8174..85b4a11064 100644
--- a/tests/test_integrations.py
+++ b/tests/test_integrations.py
@@ -1,5 +1,6 @@
from __future__ import unicode_literals
+from saleor.product.models import Category
from saleor.integrations.feeds import SaleorFeed
@@ -11,3 +12,14 @@ def test_saleor_feed_items(product_in_stock):
attributes = feed.item_attributes(items[0])
assert attributes.get('mpn') == valid_variant.sku
assert attributes.get('availability') == 'in stock'
+
+
+def test_category_formatter(db):
+ feed = SaleorFeed()
+ main_category = Category(name='Main', slug='main')
+ main_category.save()
+ sub_category = Category(name='Sub', slug='sub', parent=main_category)
+ sub_category.save()
+ assert feed.get_full_category_name_path(main_category) == 'Main'
+ assert feed.get_full_category_name_path(sub_category) == 'Main > Sub'
+