diff --git a/smash/web/tests/api_views/test_appointment.py b/smash/web/tests/api_views/test_appointment.py index ddfa8eebc56eb056094726ecfd0b8debcf506675..84a7928045d78346ec9855b29dd5fcb7e2b222bc 100644 --- a/smash/web/tests/api_views/test_appointment.py +++ b/smash/web/tests/api_views/test_appointment.py @@ -3,28 +3,20 @@ import datetime import json -from django.contrib.auth.models import User -from django.test import Client -from django.test import TestCase from django.urls import reverse from web.models import AppointmentTypeLink, AppointmentList -from web.tests.functions import create_study_subject, create_worker, create_visit, create_appointment, \ +from web.tests import LoggedInWithWorkerTestCase +from web.tests.functions import create_study_subject, create_visit, create_appointment, \ create_appointment_type, create_get_suffix, create_flying_team from web.views.appointment import APPOINTMENT_LIST_GENERIC, APPOINTMENT_LIST_APPROACHING, APPOINTMENT_LIST_UNFINISHED from web.views.notifications import get_today_midnight_date -class TestAppointmentApi(TestCase): +class TestAppointmentApi(LoggedInWithWorkerTestCase): def setUp(self): + super(TestAppointmentApi, self).setUp() self.study_subject = create_study_subject() - self.client = Client() - username = 'piotr' - password = 'top_secret' - self.user = User.objects.create_user( - username=username, email='jacob@bla', password=password) - self.worker = create_worker(self.user) - self.client.login(username=username, password=password) def test_appointments_valid(self): place = "Some new flying team location"