class FormUUIDField(TestCase):
def test_formfield_error(self):
form = ManualUUIDForm({'uuid': '123'})
self.assertFalse(form.is_valid())
This test fails. I did not check much, but I think the reason/fix is this:
to_python should raise ValidationError (i.e. wrap the StringUUID in a try except ValueError and re-raise an appropriate ValidationError)
the formfield method gives CharField as form_class, this has the effect that the to_python that is called is the CharField, this should change so that the correct to_python is called.
I excluded the tests from that PR #30, as this is broken in the current version and can be fixed independently of #30.
While working on #30, I wrote this test:
This test fails. I did not check much, but I think the reason/fix is this:
I excluded the tests from that PR #30, as this is broken in the current version and can be fixed independently of #30.