Skip to content

Commit

Permalink
fix: nursing tasks tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akurungadam committed Jan 19, 2022
1 parent 1652b12 commit c11fd68
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions healthcare/healthcare/doctype/nursing_task/test_nursing_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,29 @@ class TestNursingTask(ERPNextTestCase):
def test_creating_nursing_task_from_template(self):
task_count = frappe.db.count('Nursing Task')

template = frappe.get_doc({
'doctype': 'Nursing Checklist Template',
'title': 'Lab Checklist Template',
})
template.insert()

activity = frappe.get_doc({
'doctype': 'Healthcare Activity',
'activity': 'BP check',
})
activity.insert()

task = frappe.get_doc({
'doctype': 'Nursing Checklist Template Task',
'activity': activity.name,
'parent': template,
'parenttype': 'Nursing Checklist Template',
})
task.insert()

template.append('tasks', task)
template.save()
if not frappe.db.exists('Healthcare Activity', 'BP check'):
activity = frappe.get_doc({
'doctype': 'Healthcare Activity',
'activity': 'BP check',
})
activity.insert()

template_name = 'Lab Checklist Template'
if not frappe.db.exists('Healthcare Activity', template_name):
template = frappe.get_doc({
'doctype': 'Nursing Checklist Template',
'title': template_name,
})
task = frappe._dict({
'doctype': 'Nursing Checklist Template Task',
'activity': activity.name,
'activity_duration': 900
})
template.append('tasks', task)
template.insert()

self.lab_template = create_lab_test_template()
self.lab_template.nursing_checklist_template = template.name
self.lab_template.nursing_checklist_template = template_name
self.lab_template.save()
create_lab_test(self.lab_template)

Expand Down

0 comments on commit c11fd68

Please sign in to comment.