Skip to content
Snippets Groups Projects
Commit 1d7e2795 authored by Ben Adida's avatar Ben Adida
Browse files

added tests for single voter

parent 2ccca0b3
No related branches found
No related tags found
No related merge requests found
......@@ -453,6 +453,14 @@ class ElectionBlackboxTests(TestCase):
NUM_VOTERS = 4
self.assertEquals(len(utils.from_json(response.content)), NUM_VOTERS)
# let's get a single voter
single_voter = models.Election.objects.get(uuid = election_id).voter_set.all()[0]
response = self.client.get("/helios/elections/%s/voters/%s" % (election_id, single_voter.uuid))
self.assertContains(response, '"uuid": "%s"' % single_voter.uuid)
response = self.client.get("/helios/elections/%s/voters/foobar" % election_id)
self.assertEquals(response.status_code, 404)
# add questions
response = self.client.post("/helios/elections/%s/save_questions" % election_id, {
'questions_json': utils.to_json([{"answer_urls": [None,None], "answers": ["Alice", "Bob"], "choice_type": "approval", "max": 1, "min": 0, "question": "Who should be president?", "result_type": "absolute", "short_name": "Who should be president?", "tally_type": "homomorphic"}]),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment