def METHOD_NAME(client, phase_factory, map_idea_factory):
    phase, module, project, mapidea = setup_phase(
        phase_factory, map_idea_factory, phases.RatingPhase
    )
    url = reverse(
        "a4_candy_mapideas:mapidea-delete",
        kwargs={
            "organisation_slug": mapidea.project.organisation.slug,
            "pk": mapidea.pk,
            "year": mapidea.created.year,
        },
    )
    with freeze_phase(phase):
        count = models.MapIdea.objects.all().count()
        assert count == 1
        moderator = mapidea.module.project.moderators.first()
        client.login(username=moderator.email, password="password")
        response = client.get(url)
        assert response.status_code == 200
        assert_template_response(
            response, "a4_candy_mapideas/mapidea_confirm_delete.html"
        )
        response = client.post(url)
        assert redirect_target(response) == "project-detail"
        assert response.status_code == 302
        count = models.MapIdea.objects.all().count()
        assert count == 0