mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Refs #35169 -- Added test for ASGIRequest root_path handling.
This commit is contained in:
parent
ba4ffdc877
commit
4d2ef9bb82
@ -326,6 +326,15 @@ class AsyncHandlerRequestTests(SimpleTestCase):
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
await self.async_client.get("/unawaited/")
|
||||
|
||||
def test_root_path(self):
|
||||
async_request_factory = AsyncRequestFactory()
|
||||
request = async_request_factory.request(
|
||||
**{"path": "/root/somepath/", "root_path": "/root"}
|
||||
)
|
||||
self.assertEqual(request.path, "/root/somepath/")
|
||||
self.assertEqual(request.script_name, "/root")
|
||||
self.assertEqual(request.path_info, "/somepath/")
|
||||
|
||||
@override_settings(FORCE_SCRIPT_NAME="/FORCED_PREFIX/")
|
||||
def test_force_script_name(self):
|
||||
async_request_factory = AsyncRequestFactory()
|
||||
|
Loading…
Reference in New Issue
Block a user