Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: leave test cases #1758

Merged
merged 4 commits into from
Oct 8, 2021

Conversation

nehasacher143
Copy link

TODO:

  • Fixes
  • Patches(If required)
  • Test Cases(If required)

TraceBack:

  1. =====================================================================
    ERROR: test_make_shift_assignment (erpnext.hr.doctype.shift_assignment.test_shift_assignment.TestShiftAssignment)

Traceback (most recent call last):
File "/home/vishal/digi_frappe_sprint/apps/erpnext/erpnext/hr/doctype/shift_assignment/test_shift_assignment.py", line 23, in test_make_shift_assignment
"date": nowdate()
File "/home/vishal/digi_frappe_sprint/apps/frappe/frappe/model/document.py", line 224, in insert
self._validate_links()
File "/home/vishal/digi_frappe_sprint/apps/frappe/frappe/model/document.py", line 772, in _validate_links
frappe.LinkValidationError)
File "/home/vishal/digi_frappe_sprint/apps/frappe/frappe/init.py", line 380, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable)
File "/home/vishal/digi_frappe_sprint/apps/frappe/frappe/init.py", line 359, in msgprint
_raise_exception()
File "/home/vishal/digi_frappe_sprint/apps/frappe/frappe/init.py", line 319, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.LinkValidationError: Could not find Shift Type: Day Shift

  1. ERROR: test_salary_structure_deduction_based_on_gross_pay (erpnext.hr.doctype.salary_structure.test_salary_structure.TestSalaryStructure)

Traceback (most recent call last):
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/erpnext/erpnext/hr/doctype/salary_structure/test_salary_structure.py", line 60, in test_salary_structure_deduction_based_on_gross_pay
ss = make_salary_slip(sal_struct.name, employee = emp)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/erpnext/erpnext/hr/doctype/salary_structure/salary_structure.py", line 172, in make_salary_slip
}, target_doc, postprocess, ignore_child_tables=True, ignore_permissions=ignore_permissions)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/model/mapper.py", line 122, in get_mapped_doc
postprocess(source_doc, target_doc)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/erpnext/erpnext/hr/doctype/salary_structure/salary_structure.py", line 162, in postprocess
target.run_method('process_salary_structure', for_preview=for_preview)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/model/document.py", line 803, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/model/document.py", line 1079, in composer
return composed(self, method, *args, **kwargs)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/model/document.py", line 1062, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/model/document.py", line 797, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py", line 929, in process_salary_structure
self.calculate_net_pay()
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py", line 297, in calculate_net_pay
self.calculate_component_amounts("earnings")
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py", line 322, in calculate_component_amounts
self.set_component_amounts_based_on_payment_days(component_type)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py", line 830, in set_component_amounts_based_on_payment_days
d.amount = self.get_amount_based_on_payment_days(d, joining_date, relieving_date)[0]
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py", line 691, in get_amount_based_on_payment_days
if frappe.get_cached_value("Salary Component", row.salary_component, "round_to_the_nearest_integer"):
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/init.py", line 728, in get_cached_value
doc = get_cached_doc(doctype, name)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/init.py", line 713, in get_cached_doc
doc = get_doc(*args, **kwargs)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/init.py", line 756, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/model/document.py", line 71, in get_doc
return controller(*args, **kwargs)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/model/document.py", line 106, in init
self.load_from_db()
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/model/document.py", line 149, in load_from_db
frappe.throw(("{0} {1} not found").format((self.doctype), self.name), frappe.DoesNotExistError)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/init.py", line 380, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable)
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/init.py", line 359, in msgprint
_raise_exception()
File "/home/neha/Frappeoffice/frappe_bloomstack_core/apps/frappe/frappe/init.py", line 319, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: Salary Component Basic Salary not found

@sahil28297 sahil28297 changed the title Fix leave test cases fix: leave test cases Oct 8, 2021
@sahil28297 sahil28297 merged commit 75effc3 into Bloomstack:develop Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants