test: remove unnecessary creation of companies #28965 (#28967)

test: remove unnecessary creation of companies
(cherry picked from commit d7148adee5)

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
mergify[bot]
2021-12-20 23:22:34 +05:30
committed by GitHub
parent 87e53e9e46
commit ef47570977
5 changed files with 14 additions and 36 deletions

View File

@@ -10,13 +10,8 @@ test_records = frappe.get_test_records('Company')
class TestInit(unittest.TestCase):
def test_encode_company_abbr(self):
company = frappe.new_doc("Company")
company.company_name = "New from Existing Company For Test"
company.abbr = "NFECT"
company.default_currency = "INR"
company.save()
abbr = company.abbr
abbr = "NFECT"
names = [
"Warehouse Name", "ERPNext Foundation India", "Gold - Member - {a}".format(a=abbr),
@@ -34,7 +29,7 @@ class TestInit(unittest.TestCase):
]
for i in range(len(names)):
enc_name = encode_company_abbr(names[i], company.name)
enc_name = encode_company_abbr(names[i], abbr=abbr)
self.assertTrue(
enc_name == expected_names[i],
"{enc} is not same as {exp}".format(enc=enc_name, exp=expected_names[i])