test: fix salary component not found; other optimisation (#24920)

This commit is contained in:
Sagar Vora
2021-03-17 19:54:08 +05:30
committed by GitHub
parent cbd67e662f
commit cf3fc99b12
3 changed files with 13 additions and 2 deletions

View File

@@ -13,9 +13,18 @@ from erpnext.projects.doctype.timesheet.timesheet import make_salary_slip, make_
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.payroll.doctype.salary_structure.test_salary_structure \
import make_salary_structure, create_salary_structure_assignment
from erpnext.payroll.doctype.salary_slip.test_salary_slip import (
make_earning_salary_component,
make_deduction_salary_component
)
from erpnext.hr.doctype.employee.test_employee import make_employee
class TestTimesheet(unittest.TestCase):
@classmethod
def setUpClass(cls):
make_earning_salary_component(setup=True, company_list=['_Test Company'])
make_deduction_salary_component(setup=True, company_list=['_Test Company'])
def setUp(self):
for dt in ["Salary Slip", "Salary Structure", "Salary Structure Assignment", "Timesheet"]:
frappe.db.sql("delete from `tab%s`" % dt)