MCPcopy
hub / github.com/django/django / test_force_script_name

Method test_force_script_name

tests/handlers/tests.py:342–347  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

340
341 @override_settings(FORCE_SCRIPT_NAME="/FORCED_PREFIX")
342 def test_force_script_name(self):
343 async_request_factory = AsyncRequestFactory()
344 request = async_request_factory.request(**{"path": "/FORCED_PREFIX/somepath/"})
345 self.assertEqual(request.path, "/FORCED_PREFIX/somepath/")
346 self.assertEqual(request.script_name, "/FORCED_PREFIX")
347 self.assertEqual(request.path_info, "/somepath/")
348
349 def test_root_path_prefix_boundary(self):
350 async_request_factory = AsyncRequestFactory()

Callers

nothing calls this directly

Calls 2

requestMethod · 0.95
AsyncRequestFactoryClass · 0.90

Tested by

no test coverage detected