mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #28947 -- Fixed crash when coercing a translatable URL pattern to str.
Regression in df41b5a05d
.
This commit is contained in:
parent
04d1454350
commit
01384ce36c
3 changed files with 20 additions and 2 deletions
15
tests/urlpatterns/test_resolvers.py
Normal file
15
tests/urlpatterns/test_resolvers.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
from django.test import SimpleTestCase
|
||||
from django.urls.resolvers import RegexPattern, RoutePattern
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class RegexPatternTests(SimpleTestCase):
|
||||
|
||||
def test_str(self):
|
||||
self.assertEqual(str(RegexPattern(_('^translated/$'))), '^translated/$')
|
||||
|
||||
|
||||
class RoutePatternTests(SimpleTestCase):
|
||||
|
||||
def test_str(self):
|
||||
self.assertEqual(str(RoutePattern(_('translated/'))), 'translated/')
|
Loading…
Add table
Add a link
Reference in a new issue