zhuangxujie 01bc837fd4
Some checks failed
Server (Postgres) / Build & reinstall (setup) (push) Has been cancelled
Server (Postgres) / Python Unit Tests (1) (push) Has been cancelled
Server (Postgres) / Python Unit Tests (2) (push) Has been cancelled
Server (Postgres) / Python Unit Tests (3) (push) Has been cancelled
Server (Postgres) / Python Unit Tests (4) (push) Has been cancelled
Server (Mariadb) / Build & reinstall (setup) (push) Has been cancelled
Server (Mariadb) / Python Unit Tests (1) (push) Has been cancelled
Server (Mariadb) / Python Unit Tests (2) (push) Has been cancelled
Server (Mariadb) / Python Unit Tests (3) (push) Has been cancelled
Server (Mariadb) / Python Unit Tests (4) (push) Has been cancelled
Server (Mariadb) / Coverage Wrap Up (push) Has been cancelled
Lock threads / lock (push) Has been cancelled
Regenerate POT file (translatable strings) / Regenerate POT file (develop) (push) Has been cancelled
Regenerate POT file (translatable strings) / Regenerate POT file (version-16-hotfix) (push) Has been cancelled
Sync translations to hotfix branches / Trigger sync → version-16-hotfix (push) Has been cancelled
Create weekly release pull requests / Release (15) (push) Has been cancelled
Create weekly release pull requests / Release (16) (push) Has been cancelled
first commit
2026-07-23 16:31:28 +08:00

23 lines
909 B
Python

# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from erpnext.tests.utils import ERPNextTestSuite
class TestBoot(ERPNextTestSuite):
def test_boot_session_populates_companies_and_party_types(self):
# boot_session reads Customer count, Company list and Party Type account types via ORM/qb
# (formerly raw SQL with ifnull, which is invalid on Postgres). Exercises that on both engines.
from erpnext.startup.boot import boot_session
bootinfo = frappe._dict(sysdefaults=frappe._dict(), page_info=frappe._dict(), docs=[])
boot_session(bootinfo)
self.assertIsInstance(bootinfo.customer_count, int)
self.assertIn("party_account_types", bootinfo)
company_docs = [d for d in bootinfo.docs if d.get("doctype") == ":Company"]
self.assertTrue(any(d.get("name") == "_Test Company" for d in company_docs))