diff options
author | buzzi <buzzi.javier@gmail.com> | 2018-10-17 14:52:19 +0000 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-10-22 10:26:54 -0400 |
commit | 24cae0bedc51093b363c323af555946a8edea1a1 (patch) | |
tree | 39afc03c2f0ee34844ae383d1044e89e2607c726 /tests/validators | |
parent | 5e3463f6bcec818431f0e1f4649d6a5bd944c459 (diff) | |
download | django-24cae0bedc51093b363c323af555946a8edea1a1.tar.gz |
Fixed #29860 -- Allowed BaseValidator to accept a callable limit_value.
Diffstat (limited to 'tests/validators')
-rw-r--r-- | tests/validators/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/validators/tests.py b/tests/validators/tests.py index 9f69854902..36d0b2a520 100644 --- a/tests/validators/tests.py +++ b/tests/validators/tests.py @@ -203,6 +203,10 @@ TEST_DATA = [ (MinValueValidator(0), -1, ValidationError), (MinValueValidator(NOW), NOW - timedelta(days=1), ValidationError), + # limit_value may be a callable. + (MinValueValidator(lambda: 1), 0, ValidationError), + (MinValueValidator(lambda: 1), 1, None), + (MaxLengthValidator(10), '', None), (MaxLengthValidator(10), 10 * 'x', None), |