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

test of apopintment title with visit

parent 00e3f22c
No related branches found
No related tags found
1 merge request!99separate patient data from study data
...@@ -125,7 +125,7 @@ class Appointment(models.Model): ...@@ -125,7 +125,7 @@ class Appointment(models.Model):
title = "N/A" title = "N/A"
return title return title
else: else:
title = self.visit.subject.first_name + " " + self.visit.subject.last_name + " type: " title = self.visit.subject.subject.first_name + " " + self.visit.subject.subject.last_name + " type: "
for appointment_type in self.appointment_types.all(): for appointment_type in self.appointment_types.all():
title += appointment_type.code + ", " title += appointment_type.code + ", "
return title return title
import logging
from django.test import TestCase from django.test import TestCase
from web.tests.functions import create_appointment from web.tests.functions import create_appointment
logger = logging.getLogger(__name__)
class AppointmentModelTests(TestCase): class AppointmentModelTests(TestCase):
def test_title_for_appointment_without_visit(self): def test_title_for_appointment_without_visit(self):
...@@ -12,3 +16,7 @@ class AppointmentModelTests(TestCase): ...@@ -12,3 +16,7 @@ class AppointmentModelTests(TestCase):
appointment.save() appointment.save()
self.assertEqual(comment, appointment.title()) self.assertEqual(comment, appointment.title())
def test_title_for_appointment_with_visit(self):
appointment = create_appointment()
self.assertIsNotNone(appointment.title())
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