diff --git a/tests/handlers/tests.py b/tests/handlers/tests.py index 7a5a287da7ca..959e4737d251 100644 --- a/tests/handlers/tests.py +++ b/tests/handlers/tests.py @@ -326,6 +326,15 @@ async def test_unawaited_response(self): 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()