fix: Check in_patch before adding 'All Item Group'
diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py
index 760b20a..bb357d8 100644
--- a/erpnext/setup/doctype/item_group/item_group.py
+++ b/erpnext/setup/doctype/item_group/item_group.py
@@ -27,7 +27,7 @@
 	def validate(self):
 		super(ItemGroup, self).validate()
 
-		if not self.parent_item_group:
+		if not self.parent_item_group and not frappe.flags.in_test:
 			self.parent_item_group = 'All Item Groups'
 
 		self.make_route()