-
-
Notifications
You must be signed in to change notification settings - Fork 500
Allow all error types to BaseForm.add_error()
in documentation
#2774
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
Conversation
Would be nice to have a test in You can take inspiration from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, let's add a test :)
Due to the current implementation of I am also unaware of how to make these tests exhaustive by testing for the correct failing cases of |
Not to my knowledge, but I believe the recommanded way to handle this is just to add appropriate type-ignore comments on offending lines |
Cheers for the suggestion @UnknownPlatypus! I have now added these failure cases (still unable to test the introspection of a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I have made things!
The documentation for the method
BaseForm.add_error()
says the following:I have updated the stubs for this method to include the additional types of errors as a
list
ordict
. And made sure that thedict
type can only be passed whenfield
isNone