1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #31459 -- Fixed handling invalid indentifiers in URL path conversion.

This patch adjusted existing tests that used invalid identifiers.
This commit is contained in:
Adam Johnson
2020-04-13 09:07:28 +01:00
committed by Mariusz Felisiak
parent 578c03b276
commit 4bb33bb074
5 changed files with 13 additions and 5 deletions

View File

@@ -143,7 +143,7 @@ class UpdatedToPathTests(SimpleTestCase):
self.assertEqual(len(result), 1)
warning = result[0]
self.assertEqual(warning.id, '2_0.W001')
expected_msg = "Your URL pattern '(?P<named-group>\\d+)' has a route"
expected_msg = "Your URL pattern '(?P<named_group>\\d+)' has a route"
self.assertIn(expected_msg, warning.msg)
@override_settings(ROOT_URLCONF='check_framework.urls.path_compatibility.beginning_with_caret')

View File

@@ -1,5 +1,5 @@
from django.urls import path
urlpatterns = [
path(r'(?P<named-group>\d+)', lambda x: x),
path(r'(?P<named_group>\d+)', lambda x: x),
]