def METHOD_NAME(self):
    """Test metadata export (invalid)"""
    self.client.logout()
    # Provider without application
    provider = SAMLProvider.objects.create(
        name=generate_id(),
        authorization_flow=create_test_flow(),
    )
    response = self.client.get(
        reverse("authentik_api:samlprovider-metadata", kwargs={"pk": provider.pk}),
    )
    self.assertEqual(200, response.status_code)
    response = self.client.get(
        reverse("authentik_api:samlprovider-metadata", kwargs={"pk": "abc"}),
    )
    self.assertEqual(404, response.status_code)