test_item_group.py should use frappe/tests/test_nestedset.py as a base class and inherit its extensive tests, instead of doing the same all over again.
For one or two tree doctypes, this may not matter all too much, but will later vastly improve maintenance and testing of further tree doctypes. Also, this way we‘re backtesting the base test class.
class TestItem(unittest.TestCase):
def test_basic_tree(self, records=None):
min_lft = 1
max_rgt = frappe.db.sql("select max(rgt) from `tabItem Group`")[0][0]
Also, our class name should be TestItemGroup here.
Module
other
Version
Frappe / ERPNext: dev
Installation method
None
Relevant log output / Stack trace / Full Error Message.
Information about bug
test_item_group.py
should usefrappe/tests/test_nestedset.py
as a base class and inherit its extensive tests, instead of doing the same all over again.For one or two tree doctypes, this may not matter all too much, but will later vastly improve maintenance and testing of further tree doctypes. Also, this way we‘re backtesting the base test class.
Also, our class name should be
TestItemGroup
here.Module
other
Version
Frappe / ERPNext: dev
Installation method
None
Relevant log output / Stack trace / Full Error Message.
No response