summaryrefslogtreecommitdiff
path: root/tests/validators
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-08-02 19:53:16 +0200
committerGitHub <noreply@github.com>2023-08-02 19:53:16 +0200
commit9b9c805cedb08621bd5dc58a01a6478eb7cc49a9 (patch)
treed819686fbe32fecf4b7c73030f4b7b2f24990adc /tests/validators
parent7cd187a5ba58d7769039f487faeb9a5a2ff05540 (diff)
Removed unneeded escapes in regexes.
Special characters lose their special meaning inside sets of characters. "-" lose its special meaning if it's placed as the first or last character. Follow up to 7c6b66383da5f9a67142334cd2ed2d769739e8f1.
Diffstat (limited to 'tests/validators')
-rw-r--r--tests/validators/tests.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/validators/tests.py b/tests/validators/tests.py
index e689435e3c..cf64638ebb 100644
--- a/tests/validators/tests.py
+++ b/tests/validators/tests.py
@@ -690,24 +690,24 @@ class TestValidatorEquality(TestCase):
def test_regex_equality(self):
self.assertEqual(
- RegexValidator(r"^(?:[a-z0-9\.\-]*)://"),
- RegexValidator(r"^(?:[a-z0-9\.\-]*)://"),
+ RegexValidator(r"^(?:[a-z0-9.-]*)://"),
+ RegexValidator(r"^(?:[a-z0-9.-]*)://"),
)
self.assertNotEqual(
- RegexValidator(r"^(?:[a-z0-9\.\-]*)://"),
- RegexValidator(r"^(?:[0-9\.\-]*)://"),
+ RegexValidator(r"^(?:[a-z0-9.-]*)://"),
+ RegexValidator(r"^(?:[0-9.-]*)://"),
)
self.assertEqual(
- RegexValidator(r"^(?:[a-z0-9\.\-]*)://", "oh noes", "invalid"),
- RegexValidator(r"^(?:[a-z0-9\.\-]*)://", "oh noes", "invalid"),
+ RegexValidator(r"^(?:[a-z0-9.-]*)://", "oh noes", "invalid"),
+ RegexValidator(r"^(?:[a-z0-9.-]*)://", "oh noes", "invalid"),
)
self.assertNotEqual(
- RegexValidator(r"^(?:[a-z0-9\.\-]*)://", "oh", "invalid"),
- RegexValidator(r"^(?:[a-z0-9\.\-]*)://", "oh noes", "invalid"),
+ RegexValidator(r"^(?:[a-z0-9.-]*)://", "oh", "invalid"),
+ RegexValidator(r"^(?:[a-z0-9.-]*)://", "oh noes", "invalid"),
)
self.assertNotEqual(
- RegexValidator(r"^(?:[a-z0-9\.\-]*)://", "oh noes", "invalid"),
- RegexValidator(r"^(?:[a-z0-9\.\-]*)://"),
+ RegexValidator(r"^(?:[a-z0-9.-]*)://", "oh noes", "invalid"),
+ RegexValidator(r"^(?:[a-z0-9.-]*)://"),
)
self.assertNotEqual(
@@ -721,7 +721,7 @@ class TestValidatorEquality(TestCase):
)
def test_regex_equality_nocache(self):
- pattern = r"^(?:[a-z0-9\.\-]*)://"
+ pattern = r"^(?:[a-z0-9.-]*)://"
left = RegexValidator(pattern)
re.purge()
right = RegexValidator(pattern)