Mercurial > public > sg101
comparison bio/tests/test_forms.py @ 744:8789299c75b1
Django 1.6: test discovery as per unittest.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 29 Dec 2013 14:45:26 -0600 |
parents | bio/tests/form_tests.py@5be850a66dfc |
children | 164a39d985ef |
comparison
equal
deleted
inserted
replaced
743:66d46d31d543 | 744:8789299c75b1 |
---|---|
1 """ | |
2 Form tests for the bio application. | |
3 | |
4 """ | |
5 from django.test import TestCase | |
6 | |
7 from bio.forms import EditUserProfileForm | |
8 | |
9 | |
10 class EditUserProfileFormTestCase(TestCase): | |
11 | |
12 def test_valid_timezone(self): | |
13 | |
14 post_data = {'time_zone': 'US/Central'} | |
15 form = EditUserProfileForm(post_data) | |
16 self.assertTrue(form.is_valid()) | |
17 | |
18 def test_invalid_timezone(self): | |
19 | |
20 post_data = {'time_zone': u'Am\xe9rica/Argentina_/_Buenos_Aires'} | |
21 form = EditUserProfileForm(post_data) | |
22 self.assertFalse(form.is_valid()) | |
23 | |
24 def test_blank_timezone(self): | |
25 | |
26 form = EditUserProfileForm({}) | |
27 self.assertTrue(form.is_valid()) | |
28 |