From b214875c053a840d4848b9403cab126f7689e34c Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Wed, 29 Mar 2017 09:51:13 +0200 Subject: [PATCH] rendering visit details tests --- smash/web/tests/test_view_subjects.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/smash/web/tests/test_view_subjects.py b/smash/web/tests/test_view_subjects.py index d17229ea..39783854 100644 --- a/smash/web/tests/test_view_subjects.py +++ b/smash/web/tests/test_view_subjects.py @@ -5,7 +5,7 @@ from django.test import Client from django.test import TestCase from django.urls import reverse -from functions import create_subject, create_worker, get_test_location +from functions import create_subject, create_visit, create_appointment, create_worker, get_test_location from web.forms import SubjectAddForm, SubjectEditForm from web.models import Subject from web.models.constants import SEX_CHOICES_MALE, SUBJECT_TYPE_CHOICES_CONTROL @@ -39,6 +39,14 @@ class SubjectsViewTests(TestCase): response = self.client.get(reverse('web.views.subject_edit', kwargs={'id': subject.id})) self.assertEqual(response.status_code, 200) + def test_render_subject_visit_details(self): + subject = create_subject() + visit = create_visit(subject) + appointment = create_appointment(visit) + + response = self.client.get(reverse('web.views.subject_visit_details', kwargs={'id': subject.id})) + self.assertEqual(response.status_code, 200) + def test_save_subject_edit(self): subject = create_subject() form_subject = SubjectEditForm(instance=subject) @@ -47,8 +55,8 @@ class SubjectsViewTests(TestCase): if value is not None: form_data[key] = value - form_data['dead']="True" - form_data['resigned']="True" + form_data['dead'] = "True" + form_data['resigned'] = "True" response = self.client.post( reverse('web.views.subject_edit', kwargs={'id': subject.id}), data=form_data) @@ -94,7 +102,7 @@ class SubjectsViewTests(TestCase): def test_render_subjects_require_contact(self): subject = create_subject() - subject.datetime_contact_reminder = get_today_midnight_date()+ datetime.timedelta(days=-1) + subject.datetime_contact_reminder = get_today_midnight_date() + datetime.timedelta(days=-1) response = self.client.get(reverse('web.views.subject_require_contact')) self.assertEqual(response.status_code, 200) -- GitLab