def METHOD_NAME(
    phase_factory, proposal_factory, voting_token_factory, token_vote_factory, user, rf
):
    phase, module, project, proposal = setup_phase(
        phase_factory, proposal_factory, phases.VotingPhase
    )
    request = rf.get("/")
    middleware = SessionMiddleware()
    middleware.process_request(request)
    request.session.save()
    request.user = user
    template = (
        "{% load react_proposals_vote %}" "{% react_proposals_vote module proposal %}"
    )
    contenttype = ContentType.objects.get_for_model(Proposal)
    expected = (
        r"^<div data-mb-widget=\"vote_button\" data-attributes="
        r"\"(?P<props>{.+})\"><\/div>$"
    )
    with freeze_phase(phase):
        proposal = get_annotated_proposal(module)
        props = get_rendered_props(
            {"request": request, "module": module, "proposal": proposal},
            expected,
            template,
        )
        assert props == {
            "tokenvote_api_url": reverse(
                "tokenvotes-list",
                kwargs={"module_pk": module.pk, "content_type": contenttype.id},
            ),
            "objectID": proposal.pk,
            "session_token_voted": False,
            "token_info": None,
        }
    token = voting_token_factory(module=module)
    add_token_to_session(request.session, token)
    token_vote_factory(token=token, content_object=proposal)
    with freeze_phase(phase):
        proposal = get_annotated_proposal(module)
        props = get_rendered_props(
            {"request": request, "module": module, "proposal": proposal},
            expected,
            template,
        )
        assert props == {
            "tokenvote_api_url": reverse(
                "tokenvotes-list",
                kwargs={"module_pk": module.pk, "content_type": contenttype.id},
            ),
            "objectID": proposal.pk,
            "session_token_voted": True,
            "token_info": {
                "votes_left": True,
                "num_votes_left": token.allowed_votes - 1,
            },
        }