Re: [Django] #35703: Default URLconf detection does not take a prefix into account (was: default URLconf detection does not take a prefix into account)

5 views
Skip to first unread message

Django

unread,
Aug 23, 2024, 6:23:49 AM8/23/24
to django-...@googlegroups.com
#35703: Default URLconf detection does not take a prefix into account
----------------------------------+------------------------------------
Reporter: Maarten Breddels | Owner: (none)
Type: Bug | Status: new
Component: Error reporting | Version: 5.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by Sarah Boyce):

* component: Uncategorized => Error reporting
* has_patch: 0 => 1
* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted
* summary: default URLconf detection does not take a prefix into account
=> Default URLconf detection does not take a prefix into account

Comment:

Hi Maarten, thank you for the report!

I have written a test which you should be able to use
{{{#!diff
--- a/tests/view_tests/tests/test_debug.py
+++ b/tests/view_tests/tests/test_debug.py
@@ -398,6 +398,13 @@ class DebugViewTests(SimpleTestCase):
response, "<h1>The install worked successfully!
Congratulations!</h1>"
)

+ @override_settings(ROOT_URLCONF="view_tests.default_urls",
FORCE_SCRIPT_NAME="/FORCED_PREFIX")
+ def test_default_urlconf_script_name(self):
+ response = self.client.request(**{"path": "/FORCED_PREFIX/"})
+ self.assertContains(
+ response, "<h1>The install worked successfully!
Congratulations!</h1>"
+ )
+
@override_settings(ROOT_URLCONF="view_tests.regression_21530_urls")
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35703#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Reply all
Reply to author
Forward
0 new messages