Files
erpnext/erpnext/tests/test_init.py
ruthra kumar 33f4791698 refactor: replace IntegrationTestCase with ERPNextTestCase repo-wide
- import ERPNextTestSuite
 - use it on test class
2026-03-18 20:59:35 +05:30

47 lines
1.1 KiB
Python

from erpnext import encode_company_abbr
from erpnext.tests.utils import ERPNextTestSuite
class TestInit(ERPNextTestSuite):
def test_encode_company_abbr(self):
abbr = "NFECT"
names = [
"Warehouse Name",
"ERPNext Foundation India",
f"Gold - Member - {abbr}",
f" - {abbr}",
"ERPNext - Foundation - India",
f"ERPNext Foundation India - {abbr}",
f"No-Space-{abbr}",
"- Warehouse",
]
expected_names = [
f"Warehouse Name - {abbr}",
f"ERPNext Foundation India - {abbr}",
f"Gold - Member - {abbr}",
f" - {abbr}",
f"ERPNext - Foundation - India - {abbr}",
f"ERPNext Foundation India - {abbr}",
f"No-Space-{abbr} - {abbr}",
f"- Warehouse - {abbr}",
]
for i in range(len(names)):
enc_name = encode_company_abbr(names[i], abbr=abbr)
self.assertTrue(
enc_name == expected_names[i],
f"{enc_name} is not same as {expected_names[i]}",
)
def test_translation_files(self):
from frappe.tests.test_translate import verify_translation_files
verify_translation_files("erpnext")
def test_patches(self):
from frappe.tests.test_patches import check_patch_files
check_patch_files("erpnext")