diff --git a/smash/web/tests/test_view_notifications.py b/smash/web/tests/test_view_notifications.py index 435027842e8c2a92b38e2489c7f70830a91e43f3..a65a2e61c4295499d6bcbee208065451cf444059 100644 --- a/smash/web/tests/test_view_notifications.py +++ b/smash/web/tests/test_view_notifications.py @@ -13,9 +13,11 @@ from web.views.notifications import \ get_approaching_visits_without_appointments, \ get_approaching_visits_without_appointments_count, \ get_exceeded_visit_notifications_count, \ + get_notifications, \ get_subject_with_no_visit_notifications_count, \ get_subjects_with_reminder_count, \ get_visits_without_appointments_count, \ + get_visits_with_missing_appointments_count, \ get_today_midnight_date, \ get_unfinished_appointments, \ get_unfinished_appointments_count, \ @@ -62,6 +64,25 @@ class NotificationViewTests(TestCase): notification = get_visits_without_appointments_count(self.user) self.assertEquals(original_notification.count + 1, notification.count) + def test_get_visits_with_missing_appointments_count(self): + original_notification = get_visits_with_missing_appointments_count(self.user) + + appointment_type = create_appointment_type() + visit = create_visit() + visit.appointment_types.add(appointment_type) + visit.save() + + notification = get_visits_with_missing_appointments_count(self.user) + self.assertEquals(original_notification.count + 1, notification.count) + + def test_get_notifications(self): + create_worker(self.user) + result = get_notifications(self.user) + + self.assertEquals(0, result[0]) + self.assertTrue(isinstance(result[1], list)) + self.assertTrue(len(result[1]) > 0) + def test_get_visits_without_appointments_count_2(self): appointment_type = create_appointment_type() original_notification = get_visits_without_appointments_count(self.user)