diff options
| author | kundan223 <kundan0707y@gmail.com> | 2025-12-14 13:02:25 +0530 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2025-12-26 09:25:51 -0300 |
| commit | d35daf8600a66c0ff20e36f82969df61a7fc4981 (patch) | |
| tree | 696161deb19a6b8467879c5b5b2359ba4a623b1b /tests/urlpatterns/lazy_path_urls.py | |
| parent | 16107ab710dc23d5ea0aa17da6bf29fe89b61bb0 (diff) | |
[6.0.x] Fixed #36796 -- Handled lazy routes correctly in RoutePattern.match().
Coerce lazy route values to `str` at match time to support prefix and
endpoint matching when using `gettext_lazy()` route paths.
Regression in f920937c8a63df6bea220e4386f59cdb45b2e355.
Thanks to Andrea Angelini for the report, and to Jake Howard and Jacob
Walls for reviews.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Backport of 7bf3ac3ee255bcfe329e3203c7a2555b1275d506 from main.
Diffstat (limited to 'tests/urlpatterns/lazy_path_urls.py')
| -rw-r--r-- | tests/urlpatterns/lazy_path_urls.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/urlpatterns/lazy_path_urls.py b/tests/urlpatterns/lazy_path_urls.py new file mode 100644 index 0000000000..01fcfcb3ae --- /dev/null +++ b/tests/urlpatterns/lazy_path_urls.py @@ -0,0 +1,9 @@ +from django.urls import include, path +from django.utils.translation import gettext_lazy as _ + +from . import views + +urlpatterns = [ + path(_("included_urls/"), include("urlpatterns.included_urls")), + path(_("lazy/<slug:slug>/"), views.empty_view, name="lazy"), +] |
