From 661e8e0abfa4d8ebff930d4bcdb7bfc570a922fc Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sat, 12 Oct 2019 19:56:48 +0200 Subject: Document and test own_votes --- docs/index.rst | 3 ++- tests/test_polls.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 1a9f5f9..6e234d0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -382,7 +382,8 @@ Poll dicts 'options': # The poll options as a list of dicts, each option with a title and a # votes_count field. votes_count can be None if the poll creator has # chosen to hide vote totals until the poll expires and it hasn't yet. - 'emojis': # List of emoji dicts for all emoji used in answer strings + 'emojis': # List of emoji dicts for all emoji used in answer strings, + 'own_votes': # The logged-in users votes, as a list of indices to the options. } diff --git a/tests/test_polls.py b/tests/test_polls.py index ca7335d..2187d31 100644 --- a/tests/test_polls.py +++ b/tests/test_polls.py @@ -10,10 +10,12 @@ def test_polls(api, api2): api.poll_vote(status_poll.poll, [1]) poll2 = api.poll(poll) assert poll2.votes_count == 1 + assert poll2.own_votes == [1] api.poll_vote(status_poll.poll, [0]) poll3 = api.poll(poll) assert poll3.votes_count == 2 + assert poll3.own_votes == [1, 0] api2.status_delete(status_poll) -- cgit v1.2.3