Test fixes
This commit is contained in:
parent
68348d4130
commit
f6b784e39e
@ -11,13 +11,12 @@ from erpnext.hr.doctype.employee_onboarding.employee_onboarding import Incomplet
|
|||||||
|
|
||||||
class TestEmployeeOnboarding(unittest.TestCase):
|
class TestEmployeeOnboarding(unittest.TestCase):
|
||||||
def test_employee_onboarding_incomplete_task(self):
|
def test_employee_onboarding_incomplete_task(self):
|
||||||
if frappe.db.exists('Employee Onboarding', {'employee_name': 'Test Applicant'}):
|
if frappe.db.exists('Employee Onboarding', {'employee_name': 'Test Researcher'}):
|
||||||
return frappe.get_doc('Employee Onboarding', {'employee_name': 'Test Applicant'})
|
return frappe.get_doc('Employee Onboarding', {'employee_name': 'Test Researcher'})
|
||||||
_set_up()
|
_set_up()
|
||||||
applicant = get_job_applicant()
|
applicant = get_job_applicant()
|
||||||
onboarding = frappe.new_doc('Employee Onboarding')
|
onboarding = frappe.new_doc('Employee Onboarding')
|
||||||
onboarding.job_applicant = applicant.name
|
onboarding.job_applicant = applicant.name
|
||||||
onboarding.employee_name = 'Test Applicant'
|
|
||||||
onboarding.company = '_Test Company'
|
onboarding.company = '_Test Company'
|
||||||
onboarding.designation = 'Researcher'
|
onboarding.designation = 'Researcher'
|
||||||
onboarding.append('activities', {
|
onboarding.append('activities', {
|
||||||
@ -48,7 +47,7 @@ class TestEmployeeOnboarding(unittest.TestCase):
|
|||||||
employee.date_of_birth = '1990-05-08'
|
employee.date_of_birth = '1990-05-08'
|
||||||
employee.gender = 'Female'
|
employee.gender = 'Female'
|
||||||
employee.insert()
|
employee.insert()
|
||||||
self.assertEqual(employee.employee_name, 'Test Applicant')
|
self.assertEqual(employee.employee_name, 'Test Researcher')
|
||||||
|
|
||||||
def get_job_applicant():
|
def get_job_applicant():
|
||||||
if frappe.db.exists('Job Applicant', 'Test Researcher - test@researcher.com'):
|
if frappe.db.exists('Job Applicant', 'Test Researcher - test@researcher.com'):
|
||||||
@ -63,4 +62,9 @@ def get_job_applicant():
|
|||||||
|
|
||||||
def _set_up():
|
def _set_up():
|
||||||
for doctype in ["Employee Onboarding"]:
|
for doctype in ["Employee Onboarding"]:
|
||||||
frappe.db.sql("delete from `tab{doctype}`".format(doctype=doctype))
|
frappe.db.sql("delete from `tab{doctype}`".format(doctype=doctype))
|
||||||
|
|
||||||
|
project = "Employee Onboarding : Test Researcher - test@researcher.com"
|
||||||
|
frappe.db.sql("delete from tabProject where name=%s", project)
|
||||||
|
frappe.db.sql("delete from tabTask where project=%s", project)
|
||||||
|
frappe.db.sql("delete from `tabProject Task` where parent=%s", project)
|
||||||
|
|||||||
@ -26,4 +26,4 @@ class TestEmployeeSeparation(unittest.TestCase):
|
|||||||
self.assertEqual(separation.project, "")
|
self.assertEqual(separation.project, "")
|
||||||
|
|
||||||
def get_employee():
|
def get_employee():
|
||||||
return frappe.get_doc('Employee', {'employee_name': 'Test Applicant'})
|
return frappe.get_doc('Employee', {'employee_name': 'Test Researcher'})
|
||||||
@ -104,7 +104,7 @@ function get_filters(){
|
|||||||
{ "value": "Half-Yearly", "label": __("Half-Yearly") },
|
{ "value": "Half-Yearly", "label": __("Half-Yearly") },
|
||||||
{ "value": "Yearly", "label": __("Yearly") }
|
{ "value": "Yearly", "label": __("Yearly") }
|
||||||
],
|
],
|
||||||
"default": "Monthly",
|
"default": "Yearly",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
// Note:
|
// Note:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user