fix: Job offer is mandatory for employee onboarding (#22791)

This commit is contained in:
Nabin Hait 2020-07-23 18:09:35 +05:30 committed by GitHub
parent 3c8c346227
commit 8712ac6d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ import unittest
from frappe.utils import nowdate
from erpnext.hr.doctype.employee_onboarding.employee_onboarding import make_employee
from erpnext.hr.doctype.employee_onboarding.employee_onboarding import IncompleteTaskError
from erpnext.hr.doctype.job_offer.test_job_offer import create_job_offer
class TestEmployeeOnboarding(unittest.TestCase):
def test_employee_onboarding_incomplete_task(self):
@ -15,8 +16,13 @@ class TestEmployeeOnboarding(unittest.TestCase):
frappe.delete_doc('Employee Onboarding', {'employee_name': 'Test Researcher'})
_set_up()
applicant = get_job_applicant()
job_offer = create_job_offer(job_applicant=applicant.name)
job_offer.submit()
onboarding = frappe.new_doc('Employee Onboarding')
onboarding.job_applicant = applicant.name
onboarding.job_offer = job_offer.name
onboarding.company = '_Test Company'
onboarding.designation = 'Researcher'
onboarding.append('activities', {