diff --git a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py index 3a234b6fa97..07792b5ea54 100644 --- a/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py +++ b/erpnext/hr/doctype/leave_allocation/test_leave_allocation.py @@ -18,6 +18,7 @@ class TestLeaveAllocation(FrappeTestCase): def setUp(self): frappe.db.delete("Leave Period") frappe.db.delete("Leave Allocation") + frappe.db.delete("Leave Ledger Entry") emp_id = make_employee("test_emp_leave_allocation@salary.com", company="_Test Company") self.employee = frappe.get_doc("Employee", emp_id) @@ -369,7 +370,7 @@ class TestLeaveAllocation(FrappeTestCase): self.assertEqual(leave_allocation.total_leaves_allocated, 40) def test_leave_addition_after_submit_with_carry_forward(self): - from hrms.hr.doctype.leave_application.test_leave_application import ( + from erpnext.hr.doctype.leave_application.test_leave_application import ( create_carry_forwarded_allocation, ) @@ -421,7 +422,7 @@ class TestLeaveAllocation(FrappeTestCase): self.assertEqual(leave_allocation.total_leaves_allocated, 10) def test_leave_subtraction_after_submit_with_carry_forward(self): - from hrms.hr.doctype.leave_application.test_leave_application import ( + from erpnext.hr.doctype.leave_application.test_leave_application import ( create_carry_forwarded_allocation, ) diff --git a/erpnext/hr/doctype/leave_type/test_leave_type.py b/erpnext/hr/doctype/leave_type/test_leave_type.py index 628f16d0654..56bf641d261 100644 --- a/erpnext/hr/doctype/leave_type/test_leave_type.py +++ b/erpnext/hr/doctype/leave_type/test_leave_type.py @@ -9,7 +9,7 @@ test_records = frappe.get_test_records("Leave Type") def create_leave_type(**args): args = frappe._dict(args) if frappe.db.exists("Leave Type", args.leave_type_name): - frappe.delete_doc("Leave Type", args.leave_type_name) + frappe.delete_doc("Leave Type", args.leave_type_name, force=True) leave_type = frappe.get_doc( {