def test_clean_timezone_invalid(self):
     form = SelectTimeZoneForm(data={'timezone': 'INVALIDBYINTENT'},
                               instance=self.user)
     self.assertFalse(form.is_valid())
     self.assertEqual(form.errors['timezone'], [INVALID_TIMEZONE_ERROR])
 def test_clean_timezone_valid(self):
     form = SelectTimeZoneForm(data={'timezone': 'Europe/Berlin'},
                               instance=self.user)
     self.assertTrue(form.is_valid())
 def test_clean_timezone_empty(self):
     form = SelectTimeZoneForm(data={}, instance=self.user)
     self.assertFalse(form.is_valid())
     self.assertEqual(form.errors['timezone'], [EMPTY_TIMEZONE_ERROR])