Skip to content

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

PEP8

Pacu2afc274cc1644
diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.py
index 9cfb9de059..98456cb7ba 100644
--- a/saleor/core/utils/random_data.py
+++ b/saleor/core/utils/random_data.py
@@ -262,12 +262,14 @@ def get_or_create_category(schema, placeholder_dir):
return Category.objects.get_or_create(
name=category_name, defaults=defaults)[0]
+
def get_product_list_image(image_dir):
image_root_dir = os.path.join(settings.PROJECT_ROOT, image_dir)
random_img_path = random.choice(os.listdir(image_root_dir))
img_path = os.path.join(image_dir, random_img_path)
return File(open(img_path, 'rb'))
+
def get_or_create_product_type(name, **kwargs):
return ProductType.objects.get_or_create(name=name, defaults=kwargs)[0]