예제 #1
0
 def test_timezone_raises_ValueError(self):
     for tz in ["America", None, "", "Mars", "DT"]:
         with self.assertRaises(ValueError):
             validatorfuncs.timezone(tz)
예제 #2
0
    def test_timezone_ok(self):

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