1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixes #13511 -- make regex parameter to RegexValidator to be optional. Also tidies up related docs (parameters aren't attributes). Thanks for the patch work, davidfischer.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16351 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Chris Beaven
2011-06-09 23:51:03 +00:00
parent db2f9bfae1
commit b56ef75088
3 changed files with 28 additions and 14 deletions

View File

@@ -112,6 +112,11 @@ TEST_DATA = (
(BaseValidator(True), True, None),
(BaseValidator(True), False, ValidationError),
(RegexValidator(), '', None),
(RegexValidator(), 'x1x2', None),
(RegexValidator('[0-9]+'), 'xxxxxx', ValidationError),
(RegexValidator('[0-9]+'), '1234', None),
(RegexValidator(re.compile('[0-9]+')), '1234', None),
(RegexValidator('.*'), '', None),
(RegexValidator(re.compile('.*')), '', None),
(RegexValidator('.*'), 'xxxxx', None),