summaryrefslogtreecommitdiff
path: root/tests/handlers
diff options
context:
space:
mode:
authorBas Peschier <basp@fabrique.nl>2015-03-08 15:06:23 +0100
committerMarkus Holtermann <info@markusholtermann.eu>2015-03-08 15:48:27 +0100
commit336512fae77ec214ad6db24166b9a8676007cc09 (patch)
treefa3b5d711f82dca40d4cd43ead6c498747196257 /tests/handlers
parenta5b225084f69e27b78fab0f2954fa9520656976e (diff)
Fixed #23173 -- Fixed incorrect stripping of SCRIPT_URL
Diffstat (limited to 'tests/handlers')
-rw-r--r--tests/handlers/tests.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/handlers/tests.py b/tests/handlers/tests.py
index a1fed74105..e7c03dd971 100644
--- a/tests/handlers/tests.py
+++ b/tests/handlers/tests.py
@@ -2,7 +2,7 @@
from __future__ import unicode_literals
-from django.core.handlers.wsgi import WSGIHandler, WSGIRequest
+from django.core.handlers.wsgi import WSGIHandler, WSGIRequest, get_script_name
from django.core.signals import request_finished, request_started
from django.db import close_old_connections, connection
from django.test import (
@@ -200,3 +200,14 @@ class HandlerNotFoundTest(TestCase):
def test_environ_path_info_type(self):
environ = RequestFactory().get('/%E2%A8%87%87%A5%E2%A8%A0').environ
self.assertIsInstance(environ['PATH_INFO'], six.text_type)
+
+
+class ScriptNameTests(TestCase):
+ def test_get_script_name(self):
+ # Regression test for #23173
+ # Test first without PATH_INFO
+ script_name = get_script_name({'SCRIPT_URL': '/foobar/'})
+ self.assertEqual(script_name, '/foobar/')
+
+ script_name = get_script_name({'SCRIPT_URL': '/foobar/', 'PATH_INFO': '/'})
+ self.assertEqual(script_name, '/foobar')