From 0dccc7a05e513a301fc73f3d18ae6b8b723098ec Mon Sep 17 00:00:00 2001 From: Ben Adida <ben@adida.net> Date: Sun, 22 Aug 2010 18:44:36 -0700 Subject: [PATCH] started helios model tests --- helios/tests.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 helios/tests.py diff --git a/helios/tests.py b/helios/tests.py new file mode 100644 index 0000000..fb929a3 --- /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 + -- GitLab