3131
3232@pytest .mark .django_db
3333class TestRecordMedicalInformationPresenter :
34- def test_formats_symptoms_summary_list (self ):
35- appointment = AppointmentFactory .create ()
36-
34+ def _create_default_symptoms (self , appointment ):
3735 symptom1 = SymptomFactory .create (
3836 lump = True ,
3937 appointment = appointment ,
@@ -43,22 +41,19 @@ def test_formats_symptoms_summary_list(self):
4341 when_resolved = "resolved date" ,
4442 additional_information = "abc" ,
4543 )
46-
4744 symptom2 = SymptomFactory .create (
4845 swelling_or_shape_change = True ,
4946 appointment = appointment ,
5047 when_started = RelativeDateChoices .LESS_THAN_THREE_MONTHS ,
5148 area = SymptomAreas .BOTH_BREASTS ,
5249 )
53-
5450 symptom3 = SymptomFactory .create (
5551 other = True ,
5652 appointment = appointment ,
5753 when_started = RelativeDateChoices .LESS_THAN_THREE_MONTHS ,
5854 area = SymptomAreas .RIGHT_BREAST ,
5955 symptom_sub_type_details = "abc" ,
6056 )
61-
6257 symptom4 = SymptomFactory .create (
6358 other = True ,
6459 appointment = appointment ,
@@ -67,6 +62,13 @@ def test_formats_symptoms_summary_list(self):
6762 highlight_to_readers = False ,
6863 symptom_sub_type_details = "xyz" ,
6964 )
65+ return symptom1 , symptom2 , symptom3 , symptom4
66+
67+ def test_symptom_rows (self ):
68+ appointment = AppointmentFactory .create ()
69+ symptom1 , symptom2 , symptom3 , symptom4 = self ._create_default_symptoms (
70+ appointment
71+ )
7072
7173 presenter = MedicalInformationPresenter (appointment )
7274
@@ -143,6 +145,78 @@ def test_formats_symptoms_summary_list(self):
143145 },
144146 ]
145147
148+ def test_read_only_symptom_rows (self ):
149+ appointment = AppointmentFactory .create ()
150+ self ._create_default_symptoms (appointment )
151+
152+ presenter = MedicalInformationPresenter (appointment )
153+
154+ assert presenter .read_only_symptom_rows == [
155+ {
156+ "key" : {
157+ "html" : 'Lump<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>' ,
158+ },
159+ "value" : {
160+ "html" : "Left breast<br>Not sure<br>Symptom is intermittent<br>Stopped: resolved date<br>Not investigated<br>Additional information: abc" ,
161+ },
162+ },
163+ {
164+ "key" : {
165+ "html" : 'Other<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>'
166+ },
167+ "value" : {
168+ "html" : "Description: abc<br>Right breast<br>Less than 3 months ago<br>Not investigated"
169+ },
170+ },
171+ {
172+ "key" : {"text" : "Other" },
173+ "value" : {
174+ "html" : "Description: xyz<br>Left breast<br>Less than 3 months ago<br>Not investigated"
175+ },
176+ },
177+ {
178+ "key" : {
179+ "html" : 'Swelling or shape change<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>' ,
180+ },
181+ "value" : {
182+ "html" : "Both breasts<br>Less than 3 months ago<br>Not investigated" ,
183+ },
184+ },
185+ ]
186+
187+ def test_significant_symptom_rows (self ):
188+ appointment = AppointmentFactory .create ()
189+ self ._create_default_symptoms (appointment )
190+
191+ presenter = MedicalInformationPresenter (appointment )
192+
193+ assert presenter .significant_symptom_rows == [
194+ {
195+ "key" : {
196+ "html" : 'Lump<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>' ,
197+ },
198+ "value" : {
199+ "html" : "Left breast<br>Not sure<br>Symptom is intermittent<br>Stopped: resolved date<br>Not investigated<br>Additional information: abc" ,
200+ },
201+ },
202+ {
203+ "key" : {
204+ "html" : 'Other<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>'
205+ },
206+ "value" : {
207+ "html" : "Description: abc<br>Right breast<br>Less than 3 months ago<br>Not investigated"
208+ },
209+ },
210+ {
211+ "key" : {
212+ "html" : 'Swelling or shape change<br><strong class="nhsuk-tag app-nowrap nhsuk-tag--yellow">Highlight to image readers</strong>' ,
213+ },
214+ "value" : {
215+ "html" : "Both breasts<br>Less than 3 months ago<br>Not investigated" ,
216+ },
217+ },
218+ ]
219+
146220 def test_add_lump_button (self ):
147221 appointment = AppointmentFactory ()
148222
0 commit comments