fixed tests for IS_LIST_OF

This commit is contained in:
mdipierro
2018-06-01 12:56:45 -05:00
parent c3f11dc976
commit 7fce2d04af
4 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.16.1-stable+timestamp.2018.05.01.21.42.57
Version 2.16.1-stable+timestamp.2018.05.24.15.00.45
+2 -2
View File
@@ -765,9 +765,9 @@ class TestValidators(unittest.TestCase):
rtn = IS_LIST_OF(IS_INT_IN_RANGE(0, 10))(1)
self.assertEqual(rtn, ([1], None))
rtn = IS_LIST_OF(IS_INT_IN_RANGE(0, 10), minimum=10)([1, 2])
self.assertEqual(rtn, ([1, 2], 'Enter between 10 and 100 values'))
self.assertEqual(rtn, ([1, 2], 'Minimum length is 10'))
rtn = IS_LIST_OF(IS_INT_IN_RANGE(0, 10), maximum=2)([1, 2, 3])
self.assertEqual(rtn, ([1, 2, 3], 'Enter between 0 and 2 values'))
self.assertEqual(rtn, ([1, 2, 3], 'Maximum length is 2'))
# regression test for issue 742
rtn = IS_LIST_OF(minimum=1)('')
self.assertEqual(rtn, ([], 'Enter between 1 and 100 values'))
+1 -2
View File
@@ -2568,8 +2568,7 @@ class IS_DATETIME_IN_RANGE(IS_DATETIME):
class IS_LIST_OF(Validator):
def __init__(self, other=None, minimum=None, maximum=None,
error_message=None):
def __init__(self, other=None, minimum=None, maximum=None, error_message=None):
self.other = other
self.minimum = minimum
self.maximum = maximum