From 2933cf243a3d04cfb67ccfcc28e54bbe5019cbad Mon Sep 17 00:00:00 2001 From: marination Date: Tue, 1 Feb 2022 12:08:33 +0530 Subject: [PATCH] fix: Failing test, sider and linter - Remove unused imports - fix test `test_product_list_attribute_filter_builder` --- .../product_data_engine/test_product_data_engine.py | 4 +--- .../e_commerce/variant_selector/test_variant_selector.py | 2 -- erpnext/stock/doctype/item/item.py | 8 +------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/erpnext/e_commerce/product_data_engine/test_product_data_engine.py b/erpnext/e_commerce/product_data_engine/test_product_data_engine.py index 925e6e7be3..9ec336d156 100644 --- a/erpnext/e_commerce/product_data_engine/test_product_data_engine.py +++ b/erpnext/e_commerce/product_data_engine/test_product_data_engine.py @@ -175,9 +175,7 @@ class TestProductDataEngine(unittest.TestCase): filter_engine = ProductFiltersBuilder() attribute_filter = filter_engine.get_attribute_filters()[0] - attributes = attribute_filter.item_attribute_values - - attribute_values = [d.attribute_value for d in attributes] + attribute_values = attribute_filter.item_attribute_values self.assertEqual(attribute_filter.name, "Test Size") self.assertGreater(len(attribute_values), 0) diff --git a/erpnext/e_commerce/variant_selector/test_variant_selector.py b/erpnext/e_commerce/variant_selector/test_variant_selector.py index 0412abb4d9..b83961e6e1 100644 --- a/erpnext/e_commerce/variant_selector/test_variant_selector.py +++ b/erpnext/e_commerce/variant_selector/test_variant_selector.py @@ -1,5 +1,3 @@ -import unittest - import frappe from erpnext.controllers.item_variant import create_variant diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 2c78b2c634..b9e8b3f2f1 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -2,7 +2,6 @@ # License: GNU General Public License v3. See license.txt import copy -import itertools import json from typing import List @@ -18,11 +17,9 @@ from frappe.utils import ( getdate, now_datetime, nowtime, - random_string, strip, ) from frappe.utils.html_utils import clean_html -from frappe.website.utils import clear_cache import erpnext from erpnext.controllers.item_variant import ( @@ -32,10 +29,7 @@ from erpnext.controllers.item_variant import ( make_variant_item_code, validate_item_variant_attributes, ) -from erpnext.setup.doctype.item_group.item_group import ( - get_parent_item_groups, - invalidate_cache_for, -) +from erpnext.setup.doctype.item_group.item_group import invalidate_cache_for from erpnext.stock.doctype.item_default.item_default import ItemDefault