def METHOD_NAME(self):
    """Test terminate_other_sessions"""
    self.stage.terminate_other_sessions = True
    self.stage.save()
    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()
    key = generate_id()
    other_session = AuthenticatedSession.objects.create(
        user=self.user,
        session_key=key,
        last_ip=DEFAULT_IP,
    )
    cache.set(f"{KEY_PREFIX}{other_session.session_key}", "foo")
    response = self.client.post(
        reverse("authentik_api:flow-executor", kwargs={"flow_slug": self.flow.slug})
    )
    self.assertEqual(response.status_code, 200)
    self.assertStageRedirects(response, reverse("authentik_core:root-redirect"))
    self.assertFalse(AuthenticatedSession.objects.filter(session_key=key))
    self.assertFalse(cache.has_key(f"{KEY_PREFIX}{key}"))