Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

53 wiersze
1.3 KiB

  1. import unittest
  2. import frappe
  3. from erpnext import encode_company_abbr
  4. test_records = frappe.get_test_records("Company")
  5. class TestInit(unittest.TestCase):
  6. def test_encode_company_abbr(self):
  7. abbr = "NFECT"
  8. names = [
  9. "Warehouse Name",
  10. "ERPNext Foundation India",
  11. "Gold - Member - {a}".format(a=abbr),
  12. " - {a}".format(a=abbr),
  13. "ERPNext - Foundation - India",
  14. "ERPNext Foundation India - {a}".format(a=abbr),
  15. "No-Space-{a}".format(a=abbr),
  16. "- Warehouse",
  17. ]
  18. expected_names = [
  19. "Warehouse Name - {a}".format(a=abbr),
  20. "ERPNext Foundation India - {a}".format(a=abbr),
  21. "Gold - Member - {a}".format(a=abbr),
  22. " - {a}".format(a=abbr),
  23. "ERPNext - Foundation - India - {a}".format(a=abbr),
  24. "ERPNext Foundation India - {a}".format(a=abbr),
  25. "No-Space-{a} - {a}".format(a=abbr),
  26. "- Warehouse - {a}".format(a=abbr),
  27. ]
  28. for i in range(len(names)):
  29. enc_name = encode_company_abbr(names[i], abbr=abbr)
  30. self.assertTrue(
  31. enc_name == expected_names[i],
  32. "{enc} is not same as {exp}".format(enc=enc_name, exp=expected_names[i]),
  33. )
  34. def test_translation_files(self):
  35. from frappe.tests.test_translate import verify_translation_files
  36. verify_translation_files("erpnext")
  37. def test_patches(self):
  38. from frappe.tests.test_patches import check_patch_files
  39. check_patch_files("erpnext")