'Fetch the SAML metadata and do some validation'

def _validate_signed_metadata(self, pub_key_starts_with='MIICsDCCAhmgAw'):

    doc = self._fetch_metadata()
    sig_node = doc.find('.//{}'.format(etree.QName(XMLDSIG_XML_NS, 'SignatureValue')))
    self.assertIsNotNone(sig_node)
    pub_key_node = doc.find('.//{}'.format(etree.QName(XMLDSIG_XML_NS, 'X509Certificate')))
    self.assertIsNotNone(pub_key_node)
    self.assertIn(pub_key_starts_with, pub_key_node.text)
