fix: flaky salary slip email test (#30358)
This commit is contained in:
parent
41db43cdc5
commit
f606d2ecc6
@ -708,6 +708,8 @@ def submit_salary_slips_for_employees(payroll_entry, salary_slips, publish_progr
|
|||||||
if not_submitted_ss:
|
if not_submitted_ss:
|
||||||
frappe.msgprint(_("Could not submit some Salary Slips"))
|
frappe.msgprint(_("Could not submit some Salary Slips"))
|
||||||
|
|
||||||
|
frappe.flags.via_payroll_entry = False
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
@frappe.validate_and_sanitize_search_inputs
|
||||||
def get_payroll_entries_for_jv(doctype, txt, searchfield, start, page_len, filters):
|
def get_payroll_entries_for_jv(doctype, txt, searchfield, start, page_len, filters):
|
||||||
|
@ -38,6 +38,8 @@ from erpnext.payroll.doctype.salary_structure.salary_structure import make_salar
|
|||||||
class TestSalarySlip(unittest.TestCase):
|
class TestSalarySlip(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
setup_test()
|
setup_test()
|
||||||
|
frappe.flags.pop("via_payroll_entry", None)
|
||||||
|
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
frappe.db.rollback()
|
frappe.db.rollback()
|
||||||
@ -409,15 +411,17 @@ class TestSalarySlip(unittest.TestCase):
|
|||||||
"email_salary_slip_to_employee": 1
|
"email_salary_slip_to_employee": 1
|
||||||
})
|
})
|
||||||
def test_email_salary_slip(self):
|
def test_email_salary_slip(self):
|
||||||
frappe.db.sql("delete from `tabEmail Queue`")
|
frappe.db.delete("Email Queue")
|
||||||
|
|
||||||
make_employee("test_email_salary_slip@salary.com", company="_Test Company")
|
user_id = "test_email_salary_slip@salary.com"
|
||||||
ss = make_employee_salary_slip("test_email_salary_slip@salary.com", "Monthly", "Test Salary Slip Email")
|
|
||||||
|
make_employee(user_id, company="_Test Company")
|
||||||
|
ss = make_employee_salary_slip(user_id, "Monthly", "Test Salary Slip Email")
|
||||||
ss.company = "_Test Company"
|
ss.company = "_Test Company"
|
||||||
ss.save()
|
ss.save()
|
||||||
ss.submit()
|
ss.submit()
|
||||||
|
|
||||||
email_queue = frappe.db.sql("""select name from `tabEmail Queue`""")
|
email_queue = frappe.db.a_row_exists("Email Queue")
|
||||||
self.assertTrue(email_queue)
|
self.assertTrue(email_queue)
|
||||||
|
|
||||||
def test_loan_repayment_salary_slip(self):
|
def test_loan_repayment_salary_slip(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user