From f2fbe9049faa798c87c3b356e18f713b1660d08d Mon Sep 17 00:00:00 2001 From: marination Date: Tue, 11 Jan 2022 22:43:39 +0530 Subject: [PATCH] fix: Server Side test - teardown correctly --- .../e_commerce/variant_selector/test_variant_selector.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/e_commerce/variant_selector/test_variant_selector.py b/erpnext/e_commerce/variant_selector/test_variant_selector.py index 608ff230a6..31c86f1fd5 100644 --- a/erpnext/e_commerce/variant_selector/test_variant_selector.py +++ b/erpnext/e_commerce/variant_selector/test_variant_selector.py @@ -39,8 +39,7 @@ class TestVariantSelector(unittest.TestCase): }) variant.save() - @classmethod - def tearDownClass(cls): + def tearDown(self): frappe.db.rollback() def test_item_attributes(self): @@ -72,6 +71,10 @@ class TestVariantSelector(unittest.TestCase): # Only L and M attribute values must be fetched since S is disabled self.assertEqual(len(attr_data[0]["values"]), 2) # ['Medium', 'Large'] + # teardown + small_variant.disabled = 1 + small_variant.save() + def test_next_item_variant_values(self): """ Test if on selecting an attribute value, the next possible values