mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #29007 -- Fixed DecimalValidator crash on NaN, SNan, Inf, and Infinity values.
This commit is contained in:
committed by
Tim Graham
parent
c886f3dee3
commit
f636f0bb86
@@ -271,6 +271,14 @@ TEST_DATA = [
|
||||
(DecimalValidator(max_digits=5, decimal_places=2), Decimal('7304E-3'), ValidationError),
|
||||
(DecimalValidator(max_digits=5, decimal_places=5), Decimal('70E-5'), None),
|
||||
(DecimalValidator(max_digits=5, decimal_places=5), Decimal('70E-6'), ValidationError),
|
||||
# 'Enter a number.' errors
|
||||
*[
|
||||
(DecimalValidator(decimal_places=2, max_digits=10), Decimal(value), ValidationError)
|
||||
for value in (
|
||||
'NaN', '-NaN', '+NaN', 'sNaN', '-sNaN', '+sNaN',
|
||||
'Inf', '-Inf', '+Inf', 'Infinity', '-Infinity', '-Infinity',
|
||||
)
|
||||
],
|
||||
|
||||
(validate_image_file_extension, ContentFile('contents', name='file.jpg'), None),
|
||||
(validate_image_file_extension, ContentFile('contents', name='file.png'), None),
|
||||
|
||||
Reference in New Issue
Block a user