diff --git a/helios/tests.py b/helios/tests.py new file mode 100644 index 0000000000000000000000000000000000000000..fb929a3e05e17ea8e1692c949b9d1c50377c19ad --- /dev/null +++ b/helios/tests.py @@ -0,0 +1,35 @@ +""" +Unit Tests for Helios +""" + +import unittest +import models + +from auth import models as auth_models + +from django.db import IntegrityError, transaction + +from django.test.client import Client +from django.test import TestCase + +from django.core import mail + +class ElectionModelTests(unittest.TestCase): + + def setUp(self): + self.user = auth_models.User.objects.create(user_id='foobar', name='Foo Bar', user_type='password', info={}) + + def test_create_election(self): + self.election, created_p = models.Election.get_or_create( + short_name='demo', + name='Demo Election', + description='Demo Election Description', + admin=self.user) + + # election should be created + self.assertTrue(created_p) + + # should have a creation time + self.assertNotEquals(self.election.created_at, None) + #self.assert +