def test_from_python(self): v = DateTimeValidator(format=rfc3339.RFC3339_wo_Timezone) dt = datetime.datetime.now() self.assertEquals(v.from_python(dt,None),dt.strftime(rfc3339.RFC3339_wo_Timezone))
def test_to_python(self): v = DateTimeValidator(format=rfc3339.RFC3339_wo_Timezone) dt = datetime.datetime.now() v.to_python(dt.strftime(rfc3339.RFC3339_wo_Timezone),None) self.assertRaises(Invalid,v.to_python,'iuytrewq',None)