test: Add basic test for demo data

This commit is contained in:
Deepesh Garg 2023-06-26 18:33:51 +05:30
parent 85e1c85b52
commit 490b64575b

View File

@ -195,6 +195,17 @@ class TestCompany(unittest.TestCase):
child_company.save()
self.test_basic_tree()
def test_demo_data(self):
from erpnext.setup.demo import clear_demo_data, setup_demo_data
setup_demo_data()
company_name = frappe.db.get_value("Company", {"name": ("like", "%(Demo)")})
self.assertTrue(company_name)
clear_demo_data()
company_name = frappe.db.get_value("Company", {"name": ("like", "%(Demo)")})
self.assertFalse(company_name)
def create_company_communication(doctype, docname):
comm = frappe.get_doc(