def test_assertion_no_issuer(self): a = SAMLAuthenticator() tampered_etree = etree.fromstring( test_constants.tampered_assertion_no_issuer) assert not a._verify_saml_response_against_metadata( self.metadata_etree, tampered_etree) assert not a._verify_saml_response_fields(self.metadata_etree, tampered_etree)
def test_metadata_no_entity(self): a = SAMLAuthenticator() no_metadata_entity_etree = etree.fromstring( test_constants.sample_metadata_no_entity) assert a._verify_saml_response_against_metadata( no_metadata_entity_etree, self.verified_signed_xml) is False assert a._verify_saml_response_fields( no_metadata_entity_etree, self.verified_signed_xml) is False response_is_valid, signed_xml = a._test_valid_saml_response( no_metadata_entity_etree, self.response_etree) assert not response_is_valid assert etree.tostring(signed_xml) == etree.tostring( self.verified_signed_xml)