diff options
author | Aamir Khan <syst3m.w0rm@gmail.com> | 2012-08-11 12:48:28 +0530 |
---|---|---|
committer | Aamir Khan <syst3m.w0rm@gmail.com> | 2012-08-11 12:48:28 +0530 |
commit | bb4669ad706c693a9c92a3bf9b03076c9ac82189 (patch) | |
tree | 573bc2a6b20190de2959f6a0d711db682ba6ae2c /hyperkitty/tests | |
parent | ae7b7ab1a44578278a04990aac7794b87c18552f (diff) | |
download | hyperkitty-bb4669ad706c693a9c92a3bf9b03076c9ac82189.tar.gz hyperkitty-bb4669ad706c693a9c92a3bf9b03076c9ac82189.tar.xz hyperkitty-bb4669ad706c693a9c92a3bf9b03076c9ac82189.zip |
Add unit tests
Diffstat (limited to 'hyperkitty/tests')
-rw-r--r-- | hyperkitty/tests/test_models.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/hyperkitty/tests/test_models.py b/hyperkitty/tests/test_models.py index 9a056cd..26c1c29 100644 --- a/hyperkitty/tests/test_models.py +++ b/hyperkitty/tests/test_models.py @@ -18,3 +18,27 @@ # # Author: Aamir Khan <syst3m.w0rm@gmail.com> # + +import datetime +from django.test import TestCase +from hyperkitty.models import Rating, Tag + +class RatingTestCase(TestCase): + fixtures = ['rating_testdata.json'] + + def setUp(self): + super(RatingTestCase, self).setUp() + self.rating_1 = Rating.objects.get(pk=1) + self.rating_2 = Rating.objects.get(pk=2) + + def test_was_published_today(self): + # Test the value of Poll should be +1/-1 only. + self.assertTrue((self.rating_1.vote == 1) | (self.rating_1.vote == -1)) + self.assertTrue((self.rating_2.vote == 1) | (self.rating_2.vote == -1)) + +class TagTestCase(TestCase): + fixtures = ['tag_testdata.json'] + + def setUp(self): + super(TagTestCase, self).setUp() + self.tag_1 = Tag.objects.get(pk=1) |