From b56ef75088e17fa3555766e92a6747411ccd738c Mon Sep 17 00:00:00 2001 From: Chris Beaven Date: Thu, 9 Jun 2011 23:51:03 +0000 Subject: 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 --- tests/modeltests/validators/tests.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/modeltests/validators/tests.py b/tests/modeltests/validators/tests.py index e58526285b..08965c618f 100644 --- a/tests/modeltests/validators/tests.py +++ b/tests/modeltests/validators/tests.py @@ -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), -- cgit v1.3