#15126: Misleading error in ModelForm
-------------------------------------+-------------------------------------
Reporter: ingo@… | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Forms
Version: 1.2 | Severity: Normal
Resolution: | Keywords: modelform fields
Triage Stage: Accepted | attributeerror widget subset
Needs documentation: 0 | Has patch: 1
Patch needs improvement: 1 | Needs tests: 0
UI/UX: 0 | Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by ptone):
* needs_better_patch: 0 => 1
* ui_ux: => 0
* easy: => 0
Comment:
I think the test for str is reasonable.
I think this would be better implemented in the __init__ of
ModelFormOptions
also the test should use assertRaises to actually test that the assertion
is raised on instantiation, rather than fail after a class is defined,
which doesn't actually test your code.
A couple minor points:
* I believe you don't need to test for None, isinstance should suffice
* the error should be that the option should be a iterable of strings, not
a single string - list is too specific here
* You don't need to determine the type of the errant value, as you only
raise the exception for str type anyway.
--
Ticket URL: <https://code.djangoproject.com/ticket/15126#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.