11import re
2- import pytest
3-
42from datetime import datetime , timezone
3+
4+ import pytest
55from django .urls import reverse
66from playwright .sync_api import expect
77
8- from manage_breast_screening .core .utils .date_formatting import format_time , format_date
8+ from manage_breast_screening .clinics .tests .factories import ClinicFactory
9+ from manage_breast_screening .core .system_test_setup import SystemTestCase
10+ from manage_breast_screening .core .utils .date_formatting import format_date , format_time
911from manage_breast_screening .core .utils .string_formatting import (
1012 format_age ,
1113 format_nhs_number ,
1214)
13- from manage_breast_screening .participants .models import Appointment
14- from manage_breast_screening .core .system_test_setup import SystemTestCase
15+ from manage_breast_screening .participants .models import AppointmentStatus
1516from manage_breast_screening .participants .tests .factories import AppointmentFactory
16- from manage_breast_screening .clinics .tests .factories import ClinicFactory
1717
1818
1919class TestUserViewsClinicShowPage (SystemTestCase ):
@@ -44,7 +44,7 @@ def given_there_are_appointments(self):
4444 self .confirmed_appointment = AppointmentFactory (
4545 clinic_slot__clinic = self .clinic ,
4646 clinic_slot__starts_at = datetime .now (timezone .utc ).replace (hour = 9 , minute = 0 ),
47- status = Appointment . Status .CONFIRMED ,
47+ current_status = AppointmentStatus .CONFIRMED ,
4848 screening_episode__participant__first_name = "Janet" ,
4949 screening_episode__participant__last_name = "Confirmed" ,
5050 )
@@ -53,14 +53,14 @@ def given_there_are_appointments(self):
5353 clinic_slot__starts_at = datetime .now (timezone .utc ).replace (
5454 hour = 9 , minute = 30
5555 ),
56- status = Appointment . Status .CHECKED_IN ,
56+ current_status = AppointmentStatus .CHECKED_IN ,
5757 )
5858 self .screened_appointment = AppointmentFactory (
5959 clinic_slot__clinic = self .clinic ,
6060 clinic_slot__starts_at = datetime .now (timezone .utc ).replace (
6161 hour = 10 , minute = 45
6262 ),
63- status = Appointment . Status .SCREENED ,
63+ current_status = AppointmentStatus .SCREENED ,
6464 )
6565
6666 def given_i_am_on_the_clinic_list (self ):
@@ -158,5 +158,5 @@ def _expect_rows_to_match_appointments(self, rows, appointments):
158158 format_age (appointment .screening_episode .participant .age ())
159159 )
160160 expect (row .locator ("td" ).nth (3 )).to_contain_text (
161- appointment .get_status_display ()
161+ appointment .current_status . get_state_display ()
162162 )
0 commit comments