def test_valid_date(self): self.assertEquals( validators.apidate("2007-01-25"), datetime.date(2007, 1, 25) )
def test_invalid_date(self): with self.assertRaises(validators.Invalid): validators.apidate("1-1-2012")