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

unfinished appointments corresponds only to visit appointments

parent b362fffa
No related branches found
No related tags found
1 merge request!111Resolve "Unfinished appointments"
......@@ -286,6 +286,16 @@ class NotificationViewTests(LoggedInTestCase):
notification = get_unfinished_appointments_count(self.user)
self.assertEquals(original_notification.count + 1, notification.count)
def test_get_unfinished_appointments_count_for_general_appointments(self):
appointment = create_appointment()
appointment.visit = None
appointment.datetime_when = "2011-01-01"
appointment.status = Appointment.APPOINTMENT_STATUS_SCHEDULED
appointment.save()
notification = get_unfinished_appointments_count(self.user)
self.assertEquals(0, notification.count)
def test_get_unfinished_appointments_count_2(self):
original_notification = get_unfinished_appointments_count(self.user)
subject = create_study_subject()
......
......@@ -235,7 +235,7 @@ def get_unfinished_appointments(user):
datetime_when__lt=get_today_midnight_date(),
status=Appointment.APPOINTMENT_STATUS_SCHEDULED,
location__in=get_filter_locations(user),
).order_by('datetime_when')
).exclude(visit__isnull=True).order_by('datetime_when')
def waiting_for_appointment(visit):
......
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