@@ -619,40 +619,6 @@ def test_rolling_response_correct_with_customer_reply_gap(self):
619619 self .assertEqual (len (doc .rolling_responses ), 2 )
620620 self .assertEqual (doc .rolling_responses [1 ].status , "Fulfilled" )
621621
622- def test_handle_rolling_sla_status_past_failure_persists (self ):
623- """Test that a past Failed rolling response keeps sla_status as Failed,
624- even if the current response_by is in the future."""
625- sla = create_test_sla_with_priorities (rolling_responses = True )
626-
627- doc = frappe .get_doc (
628- {
629- "doctype" : "CRM Lead" ,
630- "first_name" : "Test Past Failure Persists" ,
631- "response_by" : add_to_date (now_datetime (), hours = 1 ), # Current deadline in future
632- "last_responded_on" : now_datetime (),
633- "communication_status" : "High" , # Non-default (agent replied)
634- "sla_status" : None ,
635- }
636- )
637- # Past rolling response that failed
638- doc .append (
639- "rolling_responses" ,
640- {
641- "status" : "Failed" ,
642- "response_time" : 50000 ,
643- "responded_on" : add_to_date (now_datetime (), hours = - 2 ),
644- },
645- )
646- # Current rolling response that was fulfilled
647- doc .append (
648- "rolling_responses" , {"status" : "Fulfilled" , "response_time" : 100 , "responded_on" : now_datetime ()}
649- )
650-
651- sla .handle_rolling_sla_status (doc )
652-
653- # Should still be Failed because of the past failure
654- self .assertEqual (doc .sla_status , "Failed" )
655-
656622 def test_set_rolling_responses_stale_deadline_marks_failed (self ):
657623 """Test that when response_by is a stale past deadline (from a previous cycle),
658624 the agent's response is correctly marked as Failed."""
0 commit comments