@@ -407,7 +407,7 @@ def testGetNameIdData(self):
407407 settings = OneLogin_Saml2_Settings (json_settings )
408408 response_13 = OneLogin_Saml2_Response (settings , xml_6 )
409409 nameid_data_13 = response_13 .get_nameid_data ()
410- nameid_data_13 = self .assertEqual (expected_nameid_data_5 , nameid_data_13 )
410+ self .assertEqual (expected_nameid_data_5 , nameid_data_13 )
411411
412412 json_settings ['strict' ] = False
413413 json_settings ['security' ]['wantNameId' ] = False
@@ -685,6 +685,22 @@ def testGetSessionNotOnOrAfter(self):
685685 response_3 = OneLogin_Saml2_Response (settings , xml_3 )
686686 self .assertEqual (2696012228 , response_3 .get_session_not_on_or_after ())
687687
688+ def testGetInResponseTo (self ):
689+ """
690+ Tests the retrieval of the InResponseTo attribute
691+ """
692+
693+ settings = OneLogin_Saml2_Settings (self .loadSettingsJSON ())
694+
695+ # Response without an InResponseTo element should return None
696+ xml = self .file_contents (join (self .data_path , 'responses' , 'response1.xml.base64' ))
697+ response = OneLogin_Saml2_Response (settings , xml )
698+ self .assertIsNone (response .get_in_response_to ())
699+
700+ xml_3 = self .file_contents (join (self .data_path , 'responses' , 'valid_encrypted_assertion.xml.base64' ))
701+ response_3 = OneLogin_Saml2_Response (settings , xml_3 )
702+ self .assertEqual ('ONELOGIN_be60b8caf8e9d19b7a3551b244f116c947ff247d' , response_3 .get_in_response_to ())
703+
688704 def testIsInvalidXML (self ):
689705 """
690706 Tests the is_valid method of the OneLogin_Saml2_Response
0 commit comments