Skip to content
Snippets Groups Projects
Commit 62d85dff authored by Piotr Gawron's avatar Piotr Gawron
Browse files

test for fetting all notifications added

parent 2d8c5170
No related branches found
No related tags found
1 merge request!31Tests added
Pipeline #
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment