'Localized DateFields with manually specified input formats can accept those formats'

def test_localized_dateField_with_inputformat(self):

    f = forms.DateField(input_formats=['%m.%d.%Y', '%m-%d-%Y'], localize=True)
    self.assertRaises(forms.ValidationError, f.clean, '21.12.2010')
    self.assertRaises(forms.ValidationError, f.clean, '2010-12-21')
    result = f.clean('12.21.2010')
    self.assertEqual(result, date(2010, 12, 21))
    text = f.widget._format_value(result)
    self.assertEqual(text, '21.12.2010')
    result = f.clean('12-21-2010')
    self.assertEqual(result, date(2010, 12, 21))
    text = f.widget._format_value(result)
    self.assertEqual(text, '21.12.2010')
