Skip to content

Commit

Permalink
fix: timestamp error in self leave application tests
Browse files Browse the repository at this point in the history
  • Loading branch information
asmitahase committed Dec 6, 2024
1 parent 52af770 commit f1b41ea
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions hrms/hr/doctype/leave_application/test_leave_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,19 @@ def test_self_leave_approval_allowed(self):
add_role(employee.user_id, "Leave Approver")

make_allocation_record(employee.name)
application = self.get_application(_test_records[0])
application.leave_approver = leave_approver
application = frappe.get_doc(
dict(
doctype="Leave Application",
employee=employee.name,
leave_type="_Test Leave Type",
from_date="2014-06-01",
to_date="2014-06-02",
posting_date="2014-05-30",
description="_Test Reason",
company="_Test Company",
leave_approver=leave_approver,
)
)
application.insert()
application.status = "Approved"

Expand All @@ -1011,8 +1022,19 @@ def test_self_leave_approval_not_allowed(self):
add_role(employee.user_id, "Leave Approver")

make_allocation_record(employee.name)
application = self.get_application(_test_records[0])
application.leave_approver = leave_approver
application = application = frappe.get_doc(
dict(
doctype="Leave Application",
employee=employee.name,
leave_type="_Test Leave Type",
from_date="2014-06-03",
to_date="2014-06-04",
posting_date="2014-05-30",
description="_Test Reason",
company="_Test Company",
leave_approver=leave_approver,
)
)
application.insert()
application.status = "Approved"

Expand All @@ -1021,6 +1043,7 @@ def test_self_leave_approval_not_allowed(self):

add_role(leave_approver, "Leave Approver")
frappe.set_user(leave_approver)
application.reload()
application.submit()
self.assertEqual(1, application.docstatus)

Expand Down

0 comments on commit f1b41ea

Please sign in to comment.