Skip to content
Snippets Groups Projects

Resolve "email with kit request contain double entries for patients with two appointment_types that should be included in it"

2 files
+ 24
1
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -96,6 +96,29 @@ class ViewFunctionsTests(LoggedInTestCase):
self.assertEqual(appointment1, result['appointments'][1])
self.assertEqual(appointment2, result['appointments'][2])
def test_kit_requests_for_appointment_with_two_types(self):
item = Item.objects.create(disposable=True, name="item 1")
appointment_type = create_appointment_type()
appointment_type.required_equipment.add(item)
appointment_type.save()
item = Item.objects.create(disposable=True, name="item 2")
appointment_type2 = create_appointment_type()
appointment_type2.required_equipment.add(item)
appointment_type2.save()
visit = create_visit()
appointment1 = create_appointment(visit)
appointment1.datetime_when = get_today_midnight_date() + datetime.timedelta(days=3)
appointment1.save()
AppointmentTypeLink.objects.create(appointment=appointment1, appointment_type=appointment_type)
AppointmentTypeLink.objects.create(appointment=appointment1, appointment_type=appointment_type2)
result = get_kit_requests(self.user)
self.assertEqual(1, len(result["appointments"]))
def test_kit_requests_send_email(self):
item_name = "Test item to be ordered"
item = Item.objects.create(disposable=True, name=item_name)
Loading