From c6c039ce7b328f387f3935ae3196e0e972028153 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Mon, 14 Apr 2014 21:43:10 -0300 Subject: [PATCH] cannot vote for groups that doesnt exist --- tests/vote_tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/vote_tests.py b/tests/vote_tests.py index 188f996..4e6c25b 100644 --- a/tests/vote_tests.py +++ b/tests/vote_tests.py @@ -156,5 +156,14 @@ class TestVote(LunchoTests): self.assertJsonError(rv, 409, 'Places voted more than once') return + def test_unknown_group(self): + """Try to vote in a group that doesn't exist.""" + request = {'choices': [100]} + rv = self.post('/vote/{group_id}/'.format(group_id=100), + request, + token=self.user.token) + self.assertJsonError(rv, 404, 'Group not found') + return + if __name__ == '__main__': unittest.main()