Merge pull request #16323 from sagarvora/fix_tests

fix: leave application and timesheet tests
This commit is contained in:
Sagar Vora 2019-01-03 16:38:46 +05:30 committed by GitHub
commit cda289dc27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -457,7 +457,7 @@ def get_leave_period():
return frappe.get_doc(dict( return frappe.get_doc(dict(
name = 'Test Leave Period', name = 'Test Leave Period',
doctype = 'Leave Period', doctype = 'Leave Period',
from_date = "{0}-01-01".format(now_datetime().year), from_date = "{0}-12-01".format(now_datetime().year - 1),
to_date = "{0}-12-31".format(now_datetime().year), to_date = "{0}-12-31".format(now_datetime().year),
company = "_Test Company", company = "_Test Company",
is_active = 1 is_active = 1

View File

@ -186,6 +186,8 @@ def make_salary_structure_for_timesheet(employee):
if not frappe.db.get_value("Salary Structure Assignment", if not frappe.db.get_value("Salary Structure Assignment",
{'employee':employee, 'docstatus': 1}): {'employee':employee, 'docstatus': 1}):
frappe.db.set_value('Employee', employee, 'date_of_joining',
add_months(nowdate(), -5))
create_salary_structure_assignment(employee, salary_structure.name) create_salary_structure_assignment(employee, salary_structure.name)
return salary_structure return salary_structure