mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #27648 -- Removed support for (iLmsu) regex groups in url() patterns.
Per deprecation timeline.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
from django.utils import regex_helper
|
||||
|
||||
@@ -23,16 +22,6 @@ class NormalizeTests(unittest.TestCase):
|
||||
result = regex_helper.normalize(pattern)
|
||||
self.assertEqual(result, expected)
|
||||
|
||||
def test_group_ignored(self):
|
||||
pattern = r"(?i)(?L)(?m)(?s)(?u)(?#)"
|
||||
expected = [('', [])]
|
||||
with warnings.catch_warnings(record=True) as warns:
|
||||
warnings.simplefilter('always')
|
||||
result = regex_helper.normalize(pattern)
|
||||
self.assertEqual(result, expected)
|
||||
for i, char in enumerate('iLmsu#'):
|
||||
self.assertEqual(str(warns[i].message), 'Using (?%s) in url() patterns is deprecated.' % char)
|
||||
|
||||
def test_group_noncapturing(self):
|
||||
pattern = r"(?:non-capturing)"
|
||||
expected = [('non-capturing', [])]
|
||||
|
||||
Reference in New Issue
Block a user