@@ -810,54 +810,54 @@ def testAddSign(self):
810810
811811 res = parseString (xml_authn_signed )
812812 ds_signature = res .firstChild .firstChild .nextSibling .nextSibling
813- self .assertIn ('ds:Signature' , ds_signature .tagName )
813+ self .assertEqual ('ds:Signature' , ds_signature .tagName )
814814
815815 xml_authn_dom = parseString (xml_authn )
816816 xml_authn_signed_2 = OneLogin_Saml2_Utils .add_sign (xml_authn_dom , key , cert )
817817 self .assertIn ('<ds:SignatureValue>' , xml_authn_signed_2 )
818818 res_2 = parseString (xml_authn_signed_2 )
819819 ds_signature_2 = res_2 .firstChild .firstChild .nextSibling .nextSibling
820- self .assertIn ('ds:Signature' , ds_signature_2 .tagName )
820+ self .assertEqual ('ds:Signature' , ds_signature_2 .tagName )
821821
822822 xml_authn_signed_3 = OneLogin_Saml2_Utils .add_sign (xml_authn_dom .firstChild , key , cert )
823823 self .assertIn ('<ds:SignatureValue>' , xml_authn_signed_3 )
824824 res_3 = parseString (xml_authn_signed_3 )
825825 ds_signature_3 = res_3 .firstChild .firstChild .nextSibling .nextSibling
826- self .assertIn ('ds:Signature' , ds_signature_3 .tagName )
826+ self .assertEqual ('ds:Signature' , ds_signature_3 .tagName )
827827
828828 xml_authn_etree = etree .fromstring (xml_authn )
829829 xml_authn_signed_4 = OneLogin_Saml2_Utils .add_sign (xml_authn_etree , key , cert )
830830 self .assertIn ('<ds:SignatureValue>' , xml_authn_signed_4 )
831831 res_4 = parseString (xml_authn_signed_4 )
832832 ds_signature_4 = res_4 .firstChild .firstChild .nextSibling .nextSibling
833- self .assertIn ('ds:Signature' , ds_signature_4 .tagName )
833+ self .assertEqual ('ds:Signature' , ds_signature_4 .tagName )
834834
835835 xml_authn_signed_5 = OneLogin_Saml2_Utils .add_sign (xml_authn_etree , key , cert )
836836 self .assertIn ('<ds:SignatureValue>' , xml_authn_signed_5 )
837837 res_5 = parseString (xml_authn_signed_5 )
838838 ds_signature_5 = res_5 .firstChild .firstChild .nextSibling .nextSibling
839- self .assertIn ('ds:Signature' , ds_signature_5 .tagName )
839+ self .assertEqual ('ds:Signature' , ds_signature_5 .tagName )
840840
841841 xml_logout_req = b64decode (self .file_contents (join (self .data_path , 'logout_requests' , 'logout_request.xml.base64' )))
842842 xml_logout_req_signed = OneLogin_Saml2_Utils .add_sign (xml_logout_req , key , cert )
843843 self .assertIn ('<ds:SignatureValue>' , xml_logout_req_signed )
844844 res_6 = parseString (xml_logout_req_signed )
845845 ds_signature_6 = res_6 .firstChild .firstChild .nextSibling .nextSibling
846- self .assertIn ('ds:Signature' , ds_signature_6 .tagName )
846+ self .assertEqual ('ds:Signature' , ds_signature_6 .tagName )
847847
848848 xml_logout_res = b64decode (self .file_contents (join (self .data_path , 'logout_responses' , 'logout_response.xml.base64' )))
849849 xml_logout_res_signed = OneLogin_Saml2_Utils .add_sign (xml_logout_res , key , cert )
850850 self .assertIn ('<ds:SignatureValue>' , xml_logout_res_signed )
851851 res_7 = parseString (xml_logout_res_signed )
852852 ds_signature_7 = res_7 .firstChild .firstChild .nextSibling .nextSibling
853- self .assertIn ('ds:Signature' , ds_signature_7 .tagName )
853+ self .assertEqual ('ds:Signature' , ds_signature_7 .tagName )
854854
855855 xml_metadata = self .file_contents (join (self .data_path , 'metadata' , 'metadata_settings1.xml' ))
856856 xml_metadata_signed = OneLogin_Saml2_Utils .add_sign (xml_metadata , key , cert )
857857 self .assertIn ('<ds:SignatureValue>' , xml_metadata_signed )
858858 res_8 = parseString (xml_metadata_signed )
859- ds_signature_8 = res_8 .firstChild .firstChild .nextSibling . firstChild . nextSibling
860- self .assertIn ('ds:Signature' , ds_signature_8 .tagName )
859+ ds_signature_8 = res_8 .firstChild .firstChild .nextSibling
860+ self .assertEqual ('ds:Signature' , ds_signature_8 .tagName )
861861
862862 with self .assertRaisesRegexp (Exception , 'Error parsing xml string' ):
863863 OneLogin_Saml2_Utils .add_sign (1 , key , cert )
0 commit comments