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

        try:
            date_type(1)
        except TypeError:
            pass
        else:
            raise Exception('ValidationError was excepted')
Esempio n. 3
0
 def test_valid_date(self):
     self.assertEqual(
         date_type('2014-04-11'),
         datetime.date(2014, 4, 11))