fix: leave allocation tests

This commit is contained in:
Rucha Mahabal
2023-03-14 12:24:56 +05:30
parent cdf73bb781
commit 2f62a9641e
2 changed files with 4 additions and 3 deletions

View File

@@ -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,
)

View File

@@ -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(
{