'Test that management command errors out in case of fatal exceptions instead of failing silently.'

@mock.patch('requests.get')
def test_xml_parse_exceptions(self, mocked_get):

    response = Response()
    response._content = ''
    response.status_code = 200
    mocked_get.return_value = response
    self.__create_saml_configurations__()
    expected = '\nDone.\n1    provider(s)    found    in    database.\n0    skipped    and    1    attempted.\n0    updated    and    1    failed.\n'
    with self.assertRaisesRegexp(CommandError, 'XMLSyntaxError:'):
        call_command('saml', pull=True, stdout=self.stdout)
    self.assertIn(expected, self.stdout.getvalue())
