def test_is_next_pending_appointment(self):
     dispense_appointment = DispenseAppointment.objects.filter(
         schedule__subject_identifier=self.randomized_subject.
         subject_identifier,
         is_dispensed=False).order_by('created').first()
     describe = AppointmentDescriber(
         dispense_appointment=dispense_appointment)
     self.assertTrue(describe.is_next_pending_appointment())
 def test_dispense_appointment_start_day(self):
     dispense_appointment = DispenseAppointment.objects.filter(
         schedule__subject_identifier=self.randomized_subject.
         subject_identifier,
         is_dispensed=False).order_by('created').first()
     describe = AppointmentDescriber(
         dispense_appointment=dispense_appointment)
     self.assertTrue(describe.human_readiable())
     self.assertEqual('Day 1', describe.start_day)
 def test_is_next_pending_appointment_2(self):
     dispense_appointment1 = DispenseAppointment.objects.filter(
         schedule__subject_identifier=self.randomized_subject.
         subject_identifier,
         is_dispensed=False).order_by('appt_datetime').first()
     dispense_appointment1.is_dispensed = True
     dispense_appointment1.save()
     describe = AppointmentDescriber(
         dispense_appointment=dispense_appointment1)
     self.assertFalse(describe.is_next_pending_appointment())
 def test_dispense_appointment_human_readiable_days_1(self):
     dispense_appointment = DispenseAppointment.objects.filter(
         schedule__subject_identifier=self.randomized_subject.
         subject_identifier,
         is_dispensed=False).order_by('created').first()
     dispense_appointment = dispense_appointment.next()
     appt_describe = AppointmentDescriber(
         dispense_appointment=dispense_appointment)
     self.assertTrue(appt_describe.human_readiable())
     self.assertIn('Day 8', appt_describe.human_readiable())
     self.assertIn('Day 14', appt_describe.human_readiable())