diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-05-10 13:03:39 -0700 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-05-11 12:01:28 +0200 |
commit | d6aff369ad33457ae2355b5b210faf1c4890ff35 (patch) | |
tree | 4c9d43311078bd81098e8a9fe9ff89fe007e921e /tests/view_tests | |
parent | 23f6fbdd93cd668740e3a1cd6d8c8259f380c0fe (diff) | |
download | django-d6aff369ad33457ae2355b5b210faf1c4890ff35.tar.gz |
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.
Diffstat (limited to 'tests/view_tests')
-rw-r--r-- | tests/view_tests/tests/test_debug.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index a5301b88b7..a305b77a1b 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -154,7 +154,7 @@ class DebugViewTests(SimpleTestCase): self.assertContains(response, '<div class="context" id="', status_code=500) match = re.search(b'<div class="context" id="(?P<id>[^"]+)">', response.content) self.assertIsNotNone(match) - id_repr = match.group('id') + id_repr = match['id'] self.assertFalse( re.search(b'[^c0-9]', id_repr), "Numeric IDs in debug response HTML page shouldn't be localized (value: %s)." % id_repr.decode() |