diff --git a/README.txt b/README.txt index bc91a8dd21145685f1fd71da58e9ac66c9a68f99..593ab2bdf1f17e8b8e6485e83eff7f75e54ac1f5 100644 --- a/README.txt +++ b/README.txt @@ -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 diff --git a/helios/tests.py b/helios/tests.py index 60014e625e2c37e5566fb9b30f65603bfab464d0..aae0e46cf3f03ce287cdfff9298eda1733fc9316 100644 --- a/helios/tests.py +++ b/helios/tests.py @@ -177,6 +177,7 @@ class ElectionModelTests(TestCase): self.assertEquals(voter.user, self.user) + class VoterModelTests(TestCase): fixtures = ['users.json', 'election.json'] @@ -207,7 +208,8 @@ class ElectionBlackboxTests(TestCase): fixtures = ['users.json', 'election.json'] def setUp(self): - self.election = models.Election.objects.all()[0] + 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