def test_timezone_raises_ValueError(self): for tz in ["America", None, "", "Mars", "DT"]: with self.assertRaises(ValueError): validatorfuncs.timezone(tz)
def test_timezone_ok(self): for tz in ["America/Chicago", "GMT", "UTC"]: self.assertEqual(tz, validatorfuncs.timezone(tz).zone)
def test_timezone_raises_ValueError(self): for tz in ['America', None, '', 'Mars', 'DT']: with self.assertRaises(ValueError): validatorfuncs.timezone(tz)
def validate(self, value, **kwargs): return validatorfuncs.timezone(value, option_key=self.key, **kwargs)
def test_timezone_ok(self): for tz in ['America/Chicago', 'GMT', 'UTC']: self.assertEqual(tz, validatorfuncs.timezone(tz).zone)