mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Refs #30116 -- Simplified regex match group access with Match.__getitem__().
The method has been available since Python 3.6. The shorter syntax is also marginally faster.
This commit is contained in:
parent
23f6fbdd93
commit
d6aff369ad
36 changed files with 92 additions and 92 deletions
|
@ -84,7 +84,7 @@ class TemplateStringsTests(SimpleTestCase):
|
|||
expected = '<input type="hidden" name="csrfmiddlewaretoken" value="([^"]+)">'
|
||||
match = re.match(expected, content) or re.match(expected.replace('"', "'"), content)
|
||||
self.assertTrue(match, "hidden csrftoken field not found in output")
|
||||
self.assertTrue(equivalent_tokens(match.group(1), get_token(request)))
|
||||
self.assertTrue(equivalent_tokens(match[1], get_token(request)))
|
||||
|
||||
def test_no_directory_traversal(self):
|
||||
with self.assertRaises(TemplateDoesNotExist):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue