def test_empty_values(self): field = TimezoneChoiceField(choices=ALL_CHOICES, required=False) self.assertEqual(field.clean(''), '') self.assertEqual(field.clean(None), '')
def test_coercing(self): field = TimezoneChoiceField(choices=ALL_CHOICES) self.assertEqual(field.clean(settings.TIME_ZONE), pytz.timezone(settings.TIME_ZONE))