'test date fields'

def test_21_date(self):

    record = self.env['test_new_api.mixed'].create({})
    record.date = None
    self.assertFalse(record.date)
    record.date = date(2012, 5, 1)
    self.assertEqual(record.date, '2012-05-01')
    record.date = datetime(2012, 5, 1, 10, 45, 0)
    self.assertEqual(record.date, '2012-05-01')
    record.date = '2012-05-01'
    self.assertEqual(record.date, '2012-05-01')
    with self.assertRaises(ValueError):
        record.date = '12-5-1'
