allow regexes only on strings
This commit is contained in:
@ -11,3 +11,7 @@ class RegexValidatorTest(TestCase):
|
||||
def testDoesntMatchRegex(self):
|
||||
validator = RegexValidator(re.compile("abc"))
|
||||
self.assertFalse(validator.isValid("xyz"))
|
||||
|
||||
def testFailsIfValueIsNoString(self):
|
||||
validator = RegexValidator(re.compile("abc"))
|
||||
self.assertFalse(validator.isValid(42))
|
||||
|
Reference in New Issue
Block a user