mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Refs #27648 -- Removed support for (iLmsu) regex groups in url() patterns.
Per deprecation timeline.
This commit is contained in:
parent
5bcca2a056
commit
ba42456c2e
4 changed files with 2 additions and 54 deletions
|
|
@ -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', [])]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue