Complete coverage for IS_IN_SET

Removed unreachable code in IS_IN_SET
        if failures and self.theset:
            if self.multiple and (value is None or value == '')
It's impossible to have *failures* and have value be None or '' at the same time
This commit is contained in:
Leonel Câmara
2016-03-28 14:47:58 +01:00
parent 5cbf381a2c
commit 5c292640ba
2 changed files with 4 additions and 2 deletions
+4
View File
@@ -184,6 +184,10 @@ class TestValidators(unittest.TestCase):
self.assertEqual(rtn, ('id1', None))
rtn = IS_IN_SET(['id1', 'id2'], error_message='oops', multiple=True)(None)
self.assertEqual(rtn, ([], None))
rtn = IS_IN_SET(['id1', 'id2'], error_message='oops', multiple=True)('')
self.assertEqual(rtn, ([], None))
rtn = IS_IN_SET(['id1', 'id2'], error_message='oops', multiple=True)('id1')
self.assertEqual(rtn, (['id1'], None))
rtn = IS_IN_SET(['id1', 'id2'], error_message='oops', multiple=(1,2))(None)
self.assertEqual(rtn, ([], 'oops'))
import itertools