mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-30 09:32:25 +02:00
fix: leave allocation tests
This commit is contained in:
@@ -18,6 +18,7 @@ class TestLeaveAllocation(FrappeTestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
frappe.db.delete("Leave Period")
|
frappe.db.delete("Leave Period")
|
||||||
frappe.db.delete("Leave Allocation")
|
frappe.db.delete("Leave Allocation")
|
||||||
|
frappe.db.delete("Leave Ledger Entry")
|
||||||
|
|
||||||
emp_id = make_employee("test_emp_leave_allocation@salary.com", company="_Test Company")
|
emp_id = make_employee("test_emp_leave_allocation@salary.com", company="_Test Company")
|
||||||
self.employee = frappe.get_doc("Employee", emp_id)
|
self.employee = frappe.get_doc("Employee", emp_id)
|
||||||
@@ -369,7 +370,7 @@ class TestLeaveAllocation(FrappeTestCase):
|
|||||||
self.assertEqual(leave_allocation.total_leaves_allocated, 40)
|
self.assertEqual(leave_allocation.total_leaves_allocated, 40)
|
||||||
|
|
||||||
def test_leave_addition_after_submit_with_carry_forward(self):
|
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,
|
create_carry_forwarded_allocation,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -421,7 +422,7 @@ class TestLeaveAllocation(FrappeTestCase):
|
|||||||
self.assertEqual(leave_allocation.total_leaves_allocated, 10)
|
self.assertEqual(leave_allocation.total_leaves_allocated, 10)
|
||||||
|
|
||||||
def test_leave_subtraction_after_submit_with_carry_forward(self):
|
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,
|
create_carry_forwarded_allocation,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ test_records = frappe.get_test_records("Leave Type")
|
|||||||
def create_leave_type(**args):
|
def create_leave_type(**args):
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
if frappe.db.exists("Leave Type", args.leave_type_name):
|
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(
|
leave_type = frappe.get_doc(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user