fixed tests for IS_LIST_OF
This commit is contained in:
@@ -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
|
||||
|
||||
+1
-1
Submodule gluon/packages/dal updated: b652016533...c954d1a22a
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user