def test_should_obter_respeitando_format_string(self): s = "2013-01-02T10:21:51 COO:022734" field = DateField(r'^(\d+-\d+-\d+)', format_string='%Y-%m-%d') value = field.parse_block(s) data_esperada = date(2013, 1, 2) self.assertEqual(value, data_esperada)
def test_should_return_value(self): s = "02/01/2013 10:21:51 COO:022734" field = DateField(r'^(\d+/\d+/\d+)') value = field.parse_block(s) data_esperada = date(2013, 1, 2) self.assertEqual(value, data_esperada)