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

updated tests and updated django requirement to 1.2.4

parent d6f51344
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,8 @@ The Helios Election Server
LICENSE: this code is released under the GPL v3 or later.
NEEDS:
- as of Helios v3.1, requires Django 1.2.4+
- http://github.com/openid/python-openid
- rabbitmq 1.8
-- http://www.rabbitmq.com/debian.html
......@@ -31,6 +33,6 @@ to get the south db models set up, and then:
python manage.py migrate --list
- if there are some unchecked migrations, and you are SURE that your database is up to date with the models (which should be the case if you're between v3.0.0 and v3.0.4 inclusive), then do
- if there are some unchecked migrations, and you are SURE that your database is up to date with the models (which should be the case if you're on a v3.0.x version), then do
python manage.py migrate --fake
......@@ -177,6 +177,7 @@ class ElectionModelTests(TestCase):
self.assertEquals(voter.user, self.user)
class VoterModelTests(TestCase):
fixtures = ['users.json', 'election.json']
......@@ -208,6 +209,7 @@ class ElectionBlackboxTests(TestCase):
def setUp(self):
self.election = models.Election.objects.all()[0]
self.user = auth_models.User.objects.get(user_id='ben@adida.net', user_type='google')
def test_get_election_shortcut(self):
response = self.client.get("/helios/e/%s" % self.election.short_name, follow=True)
......@@ -243,4 +245,53 @@ class ElectionBlackboxTests(TestCase):
response = self.client.get("/helios/elections/%s/voters/" % self.election.uuid, follow=False)
self.assertEquals(len(utils.from_json(response.content)), self.election.num_voters)
def test_election_creation_not_logged_in(self):
response = self.client.post("/helios/elections/new", {
"short_name" : "test-complete",
"name" : "Test Complete",
"description" : "A complete election test",
"election_type" : "referendum",
"use_voter_aliases": "0",
"use_advanced_audit_features": "1",
"private_p" : "0"})
self.assertRedirects(response, "/auth/?return_url=/helios/elections/new")
def test_do_complete_election(self):
# set up the session
session = self.client.session
session['user'] = self.user
session.save()
# create the election
response = self.client.post("/helios/elections/new", {
"short_name" : "test-complete",
"name" : "Test Complete",
"description" : "A complete election test",
"election_type" : "referendum",
"use_voter_aliases": "0",
"use_advanced_audit_features": "1",
"private_p" : "0"})
import pdb; pdb.set_trace()
# add helios as trustee
# add a few voters
# add questions
# freeze election
# vote by preparing a ballot via the server-side encryption
# cast the ballot
# confirm it
# encrypted tally
# should trigger helios decryption automatically
# combine decryptions
# check that tally matches
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment