Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form validation of mal-formed uuid is broken #31

Open
julienaubert opened this issue Mar 5, 2014 · 0 comments
Open

Form validation of mal-formed uuid is broken #31

julienaubert opened this issue Mar 5, 2014 · 0 comments
Labels

Comments

@julienaubert
Copy link

While working on #30, I wrote this test:

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:

    1. to_python should raise ValidationError (i.e. wrap the StringUUID in a try except ValueError and re-raise an appropriate ValidationError)
    1. 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.

@luto luto added the bug label Nov 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants