mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-02-26 03:27:15 +08:00
Fix ValidationError false positive on nested inputs (#943)
Reverts parts of PR 909.
This commit is contained in:
22
tests/typecheck/core/test_exceptions.yml
Normal file
22
tests/typecheck/core/test_exceptions.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
- case: ValidationError_nested_message
|
||||
main: |
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
|
||||
ValidationError({
|
||||
'list': [
|
||||
'list error 1',
|
||||
'list error 2'
|
||||
],
|
||||
'plain_str': 'message',
|
||||
'plain_error': ValidationError('message'),
|
||||
'list_error': [
|
||||
ValidationError('list error 1', code='test'),
|
||||
ValidationError('list error 2', code='test'),
|
||||
]
|
||||
})
|
||||
ValidationError([
|
||||
'message 1',
|
||||
ValidationError('message 2'),
|
||||
['nested 1', 'nested 2'],
|
||||
])
|
||||
Reference in New Issue
Block a user