summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-05-08 19:49:59 -0700
committerAndrew Godwin <andrew@aeracode.org>2014-05-08 19:49:59 -0700
commitd2e96b5792367af5aa0140f7e2673d654bb266df (patch)
tree987df9903290e381b248e72b4fb60ad452c47789 /tests
parent7194d40236fc9f848f6efd313c1636ba1aceb700 (diff)
parent724a7bf222e31f42e2ab431cc09da224081d03fa (diff)
Merge pull request #2637 from davidszotten/validator_comparisons
[1.7.x] Fixed #22588 -- Fix RegexValidator __eq__
Diffstat (limited to 'tests')
-rw-r--r--tests/validators/tests.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/validators/tests.py b/tests/validators/tests.py
index 928c482107..d073bf264f 100644
--- a/tests/validators/tests.py
+++ b/tests/validators/tests.py
@@ -296,6 +296,33 @@ class TestValidatorEquality(TestCase):
RegexValidator(r'^(?:[a-z0-9\.\-]*)://'),
)
+ self.assertNotEqual(
+ RegexValidator('', flags=re.IGNORECASE),
+ RegexValidator(''),
+ )
+
+ self.assertNotEqual(
+ RegexValidator(''),
+ RegexValidator('', inverse_match=True),
+ )
+
+ def test_regex_equality_nocache(self):
+ pattern = r'^(?:[a-z0-9\.\-]*)://'
+ left = RegexValidator(pattern)
+ re.purge()
+ right = RegexValidator(pattern)
+
+ self.assertEqual(
+ left,
+ right,
+ )
+
+ def test_regex_equality_blank(self):
+ self.assertEqual(
+ RegexValidator(),
+ RegexValidator(),
+ )
+
def test_email_equality(self):
self.assertEqual(
EmailValidator(),