Mercurial > public > sg101
view bio/tests/test_forms.py @ 924:78b459d4ab17
App refactor for custom_search for Django 1.7.7. upgrade.
This commit prevents a lot of Django warnings by creating our Haystack signal
processor as part of the custom_search apps' ready() method.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 09 Apr 2015 19:43:07 -0500 |
parents | 8789299c75b1 |
children | 164a39d985ef |
line wrap: on
line source
""" 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())