def METHOD_NAME(
    apiclient, voting_token_factory, phase_factory, proposal_factory
):
    phase, module, project, proposal = setup_phase(
        phase_factory, proposal_factory, phases.VotingPhase
    )
    proposal_ct = ContentType.objects.get_for_model(proposal.__class__)
    token = voting_token_factory(module=module)
    url_project = project.get_absolute_url()
    url_post = reverse(
        "tokenvotes-list",
        kwargs={"module_pk": module.pk, "content_type": proposal_ct.id},
    )
    url_delete = reverse(
        "tokenvotes-detail",
        kwargs={
            "module_pk": module.pk,
            "content_type": proposal_ct.id,
            "object_pk": proposal.pk,
        },
    )
    proposal_data = {"object_id": proposal.pk}
    token_data = {"token": str(token)}
    phase_started = phase.start_date + timedelta(seconds=1)
    with freeze_time(phase_started):
        # post token
        response = apiclient.post(url_project, token_data)
        assert response.status_code == 302
        # post and delete token vote
        response = apiclient.post(url_post, proposal_data, format="json")
        assert response.status_code == status.HTTP_201_CREATED
        assert TokenVote.objects.all().count() == 1
        response = apiclient.delete(url_delete, format="json")
        assert response.status_code == status.HTTP_204_NO_CONTENT
        assert TokenVote.objects.all().count() == 0
        assert "voting_tokens" in apiclient.session
        assert "token_expire_date" in apiclient.session
    with freeze_time(phase_started + TOKEN_SESSION_EXPIRE):
        response = apiclient.post(url_post, proposal_data, format="json")
        assert response.status_code == status.HTTP_403_FORBIDDEN
        assert "voting_tokens" not in apiclient.session
        assert "token_expire_date" not in apiclient.session
        # post token again
        response = apiclient.post(url_project, token_data)
        assert response.status_code == 302
        response = apiclient.post(url_post, proposal_data, format="json")
        assert response.status_code == status.HTTP_201_CREATED
        assert "voting_tokens" in apiclient.session
        assert "token_expire_date" in apiclient.session