diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bio/tests/test_forms.py	Sun Dec 29 14:45:26 2013 -0600
@@ -0,0 +1,28 @@
+"""
+Form tests for the bio application.
+
+"""
+from django.test import TestCase
+
+from bio.forms import EditUserProfileForm
+
+
+class EditUserProfileFormTestCase(TestCase):
+
+    def test_valid_timezone(self):
+
+        post_data = {'time_zone': 'US/Central'}
+        form = EditUserProfileForm(post_data)
+        self.assertTrue(form.is_valid())
+
+    def test_invalid_timezone(self):
+
+        post_data = {'time_zone': u'Am\xe9rica/Argentina_/_Buenos_Aires'}
+        form = EditUserProfileForm(post_data)
+        self.assertFalse(form.is_valid())
+
+    def test_blank_timezone(self):
+
+        form = EditUserProfileForm({})
+        self.assertTrue(form.is_valid())
+