Skip to content

Commit

Permalink
user timezone choices tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nitely committed Jun 6, 2016
1 parent 2811791 commit d255711
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spirit/user/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,19 @@ def test_profile(self):
form = UserForm(data=form_data, instance=self.user)
self.assertEqual(form.is_valid(), True)

def test_profile_timezone_field(self):
form_data = {
'first_name': 'foo', 'last_name': 'bar',
'location': 'spirit', 'timezone': 'UTC'}

form = UserProfileForm(data=form_data, instance=self.user.st)
self.assertEqual(form.is_valid(), True)

form_data['timezone'] = 'badtimezone'
form = UserProfileForm(data=form_data, instance=self.user.st)
self.assertEqual(form.is_valid(), False)
self.assertTrue('timezone' in form.errors)

def test_email_change(self):
"""
email change
Expand Down

0 comments on commit d255711

Please sign in to comment.