@@ -282,6 +282,18 @@ def test_list_attempts_filters_by_exam(self):
282282 assert data ['count' ] == 1
283283 assert data ['results' ][0 ]['exam_id' ] == exam_id
284284
285+ def test_ready_to_resume_true (self ):
286+ """Verify ready_to_resume reflects the actual attempt state."""
287+ exam_id = self ._create_exam ()
288+ attempt_id = create_exam_attempt (exam_id , self .student .id )
289+ attempt = ProctoredExamStudentAttempt .objects .get (id = attempt_id )
290+ attempt .ready_to_resume = True
291+ attempt .save ()
292+
293+ response = self .client .get (self ._url (exam_id ))
294+ assert response .status_code == status .HTTP_200_OK
295+ assert response .json ()['results' ][0 ]['ready_to_resume' ] is True
296+
285297
286298@override_settings (** PROCTORING_SETTINGS )
287299@patch .dict (settings .FEATURES , {'ENABLE_SPECIAL_EXAMS' : True })
@@ -754,3 +766,14 @@ def test_sort_attempts_descending(self):
754766 results = response .json ()['results' ]
755767 assert results [0 ]['user' ]['username' ] == 'student2'
756768 assert results [1 ]['user' ]['username' ] == 'student1'
769+
770+ def test_ready_to_resume_true (self ):
771+ """Verify ready_to_resume reflects the actual attempt state."""
772+ attempt_id = create_exam_attempt (self .exam_id , self .student .id )
773+ attempt = ProctoredExamStudentAttempt .objects .get (id = attempt_id )
774+ attempt .ready_to_resume = True
775+ attempt .save ()
776+
777+ response = self .client .get (self ._url ())
778+ assert response .status_code == status .HTTP_200_OK
779+ assert response .json ()['results' ][0 ]['ready_to_resume' ] is True
0 commit comments