1
0
mirror of https://github.com/django/django.git synced 2025-01-18 22:33:44 +00:00
django/tests/urlpatterns/test_resolvers.py
Tilmann Becker 01384ce36c Fixed #28947 -- Fixed crash when coercing a translatable URL pattern to str.
Regression in df41b5a05d4e00e80e73afe629072e37873e767a.
2017-12-20 20:36:41 -05:00

16 lines
449 B
Python

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/')