Esempio n. 1
0
 def test_invalid_datetime(self):
     try:
         datetime_type('2014-04-31')
     except ValidationError:
         pass
     else:
         raise Exception('ValidationError was excepted')
Esempio n. 2
0
    def test_invalid_argument(self):

        try:
            datetime_type(1)
        except TypeError:
            pass
        else:
            raise Exception('ValidationError was excepted')
Esempio n. 3
0
 def test_valid_datetime(self):
     self.assertEqual(
         datetime_type('2014-04-11 16:20:00.00000'),
         datetime.datetime(2014, 4, 11, 16, 20))