summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Beaven <smileychris@gmail.com>2011-06-09 23:51:03 +0000
committerChris Beaven <smileychris@gmail.com>2011-06-09 23:51:03 +0000
commitb56ef75088e17fa3555766e92a6747411ccd738c (patch)
tree09fe93f584d40a9354551c29260b3cd53ece8d34 /tests
parentdb2f9bfae173b565215a9f7320d7a45d0532f2fe (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/validators/tests.py5
1 files changed, 5 insertions, 0 deletions
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),