fix: linter and sider issues
This commit is contained in:
parent
8c055b5469
commit
19c3286b06
@ -95,12 +95,12 @@ class TestExpenseClaim(unittest.TestCase):
|
||||
def test_rejected_expense_claim(self):
|
||||
payable_account = get_payable_account(company_name)
|
||||
expense_claim = frappe.get_doc({
|
||||
"doctype": "Expense Claim",
|
||||
"employee": "_T-Employee-00001",
|
||||
"payable_account": payable_account,
|
||||
"approval_status": "Rejected",
|
||||
"expenses":
|
||||
[{ "expense_type": "Travel", "default_account": "Travel Expenses - _TC4", "amount": 300, "sanctioned_amount": 200 }]
|
||||
"doctype": "Expense Claim",
|
||||
"employee": "_T-Employee-00001",
|
||||
"payable_account": payable_account,
|
||||
"approval_status": "Rejected",
|
||||
"expenses":
|
||||
[{ "expense_type": "Travel", "default_account": "Travel Expenses - _TC4", "amount": 300, "sanctioned_amount": 200 }]
|
||||
})
|
||||
expense_claim.submit()
|
||||
|
||||
@ -112,7 +112,7 @@ class TestExpenseClaim(unittest.TestCase):
|
||||
|
||||
def test_expense_approver_perms(self):
|
||||
user = "test_approver_perm_emp@example.com"
|
||||
approver = make_employee(user, "_Test Company")
|
||||
make_employee(user, "_Test Company")
|
||||
|
||||
# check doc shared
|
||||
payable_account = get_payable_account("_Test Company")
|
||||
@ -160,21 +160,21 @@ def make_expense_claim(payable_account, amount, sanctioned_amount, company, acco
|
||||
|
||||
currency, cost_center = frappe.db.get_value('Company', company, ['default_currency', 'cost_center'])
|
||||
expense_claim = {
|
||||
"doctype": "Expense Claim",
|
||||
"employee": employee,
|
||||
"payable_account": payable_account,
|
||||
"approval_status": "Approved",
|
||||
"company": company,
|
||||
'currency': currency,
|
||||
"expenses": [{
|
||||
"doctype": "Expense Claim",
|
||||
"employee": employee,
|
||||
"payable_account": payable_account,
|
||||
"approval_status": "Approved",
|
||||
"company": company,
|
||||
"currency": currency,
|
||||
"expenses": [{
|
||||
"expense_type": "Travel",
|
||||
"default_account": account,
|
||||
"currency": currency,
|
||||
"amount": amount,
|
||||
"sanctioned_amount": sanctioned_amount,
|
||||
"cost_center": cost_center
|
||||
}]
|
||||
}
|
||||
}]
|
||||
}
|
||||
if taxes:
|
||||
expense_claim.update(taxes)
|
||||
|
||||
|
@ -342,7 +342,7 @@ class TestLeaveApplication(unittest.TestCase):
|
||||
to_date = add_days(date, 4),
|
||||
company = "_Test Company",
|
||||
docstatus = 1,
|
||||
status = "Approved"
|
||||
status = "Approved"
|
||||
))
|
||||
|
||||
self.assertRaises(frappe.ValidationError, leave_application.insert)
|
||||
@ -364,7 +364,7 @@ class TestLeaveApplication(unittest.TestCase):
|
||||
to_date = add_days(date, 4),
|
||||
company = "_Test Company",
|
||||
docstatus = 1,
|
||||
status = "Approved"
|
||||
status = "Approved"
|
||||
))
|
||||
|
||||
self.assertTrue(leave_application.insert())
|
||||
@ -394,7 +394,7 @@ class TestLeaveApplication(unittest.TestCase):
|
||||
to_date = add_days(date, 4),
|
||||
company = "_Test Company",
|
||||
docstatus = 1,
|
||||
status = "Approved"
|
||||
status = "Approved"
|
||||
))
|
||||
|
||||
self.assertRaises(frappe.ValidationError, leave_application.insert)
|
||||
@ -509,7 +509,7 @@ class TestLeaveApplication(unittest.TestCase):
|
||||
description = "_Test Reason",
|
||||
company = "_Test Company",
|
||||
docstatus = 1,
|
||||
status = "Approved"
|
||||
status = "Approved"
|
||||
))
|
||||
leave_application.submit()
|
||||
leave_ledger_entry = frappe.get_all('Leave Ledger Entry', fields='*', filters=dict(transaction_name=leave_application.name))
|
||||
@ -541,7 +541,7 @@ class TestLeaveApplication(unittest.TestCase):
|
||||
description = "_Test Reason",
|
||||
company = "_Test Company",
|
||||
docstatus = 1,
|
||||
status = "Approved"
|
||||
status = "Approved"
|
||||
))
|
||||
leave_application.submit()
|
||||
|
||||
@ -569,7 +569,7 @@ class TestLeaveApplication(unittest.TestCase):
|
||||
def test_leave_approver_perms(self):
|
||||
employee = get_employee()
|
||||
user = "test_approver_perm_emp@example.com"
|
||||
approver = make_employee(user, "_Test Company")
|
||||
make_employee(user, "_Test Company")
|
||||
|
||||
# set approver for employee
|
||||
employee.reload()
|
||||
|
@ -34,8 +34,8 @@ def validate_leave_allocation_against_leave_application(ledger):
|
||||
""", (ledger.employee, ledger.leave_type, ledger.from_date, ledger.to_date))
|
||||
|
||||
if leave_application_records:
|
||||
frappe.throw(_("Leave allocation %s is linked with leave application %s"
|
||||
% (ledger.transaction_name, ', '.join(leave_application_records))))
|
||||
frappe.throw(_("Leave allocation {0} is linked with the Leave Application {1}").format(
|
||||
ledger.transaction_name, ', '.join(leave_application_records)))
|
||||
|
||||
def create_leave_ledger_entry(ref_doc, args, submit=True):
|
||||
ledger = frappe._dict(
|
||||
|
@ -37,7 +37,7 @@ class TestShiftRequest(unittest.TestCase):
|
||||
def test_shift_request_approver_perms(self):
|
||||
employee = frappe.get_doc("Employee", "_T-Employee-00001")
|
||||
user = "test_approver_perm_emp@example.com"
|
||||
approver = make_employee(user, "_Test Company")
|
||||
make_employee(user, "_Test Company")
|
||||
|
||||
# set approver for employee
|
||||
employee.reload()
|
||||
|
Loading…
x
Reference in New Issue
Block a user