def METHOD_NAME(self):
    """Test with pending user"""
    plan = FlowPlan(flow_pk=self.flow.pk.hex, bindings=[self.binding], markers=[StageMarker()])
    plan.context[PLAN_CONTEXT_PENDING_USER] = self.user
    session = self.client.session
    session[SESSION_KEY_PLAN] = plan
    session.save()
    url = reverse("authentik_api:flow-executor", kwargs={"flow_slug": self.flow.slug})
    with patch(
        "authentik.stages.email.models.EmailStage.backend_class",
        PropertyMock(return_value=EmailBackend),
    ):
        response = self.client.post(url)
        self.assertEqual(response.status_code, 200)
        self.assertStageResponse(
            response,
            self.flow,
            response_errors={
                "non_field_errors": [{"string": "email-sent", "code": "email-sent"}]
            },
        )
        self.assertEqual(len(mail.outbox), 1)
        self.assertEqual(mail.outbox[0].subject, "authentik")
        events = Event.objects.filter(action=EventAction.EMAIL_SENT)
        self.assertEqual(len(events), 1)
        event = events.first()
        self.assertEqual(event.context["message"], f"Email to {self.user.email} sent")
        self.assertEqual(event.context["subject"], "authentik")
        self.assertEqual(event.context["to_email"], [self.user.email])
        self.assertEqual(event.context["from_email"], "system@authentik.local")