Index: AUTHORS
===================================================================
--- AUTHORS	(revision 7254)
+++ AUTHORS	(working copy)
@@ -296,6 +296,7 @@
     serbaut@gmail.com
     John Shaffer <jshaffer2112@gmail.com>
     Pete Shinners <pete@shinners.org>
+    Leo Shklovskii
     jason.sidabras@gmail.com
     Jozko Skrablin <jozko.skrablin@gmail.com>
     Ben Slavin <benjamin.slavin@gmail.com>
Index: django/test/client.py
===================================================================
--- django/test/client.py	(revision 7254)
+++ django/test/client.py	(working copy)
@@ -1,3 +1,4 @@
+import urllib
 import sys
 from cStringIO import StringIO
 from django.conf import settings
@@ -208,7 +209,7 @@
         r = {
             'CONTENT_LENGTH':  None,
             'CONTENT_TYPE':    'text/html; charset=utf-8',
-            'PATH_INFO':       path,
+            'PATH_INFO':       urllib.unquote(path),
             'QUERY_STRING':    urlencode(data, doseq=True),
             'REQUEST_METHOD': 'GET',
         }
@@ -227,7 +228,7 @@
         r = {
             'CONTENT_LENGTH': len(post_data),
             'CONTENT_TYPE':   content_type,
-            'PATH_INFO':      path,
+            'PATH_INFO':      urllib.unquote(path),
             'REQUEST_METHOD': 'POST',
             'wsgi.input':     StringIO(post_data),
         }
Index: tests/regressiontests/test_client_regress/models.py
===================================================================
--- tests/regressiontests/test_client_regress/models.py	(revision 7254)
+++ tests/regressiontests/test_client_regress/models.py	(working copy)
@@ -3,7 +3,7 @@
 
 """
 from django.test import Client, TestCase
-from django.core import mail
+from django.core.urlresolvers import reverse
 import os
 
 class AssertContainsTests(TestCase):
@@ -261,3 +261,31 @@
         # Check that assertRedirects uses the original client, not the
         # default client.
         self.assertRedirects(response, "http://testserver/test_client_regress/get_view/")
+
+
+class URLEscapingTests(TestCase):
+    def test_simple_argument_get(self):
+        "Get a view that has a simple string argument"
+        response = self.client.get(reverse('arg_view', args=['Slartibartfast']))
+        self.assertEqual(response.status_code, 200)
+        self.assertEqual(response.content, 'Howdy, Slartibartfast')
+
+    def test_argument_with_space_get(self):
+        "Get a view that has a string argument that requires escaping"
+        response = self.client.get(reverse('arg_view', args=['Arthur Dent']))
+        self.assertEqual(response.status_code, 200)
+        self.assertEqual(response.content, 'Hi, Arthur')
+
+    def test_simple_argument_post(self):
+        "Post for a view that has a simple string argument"
+        response = self.client.post(reverse('arg_view', args=['Slartibartfast']))
+        self.assertEqual(response.status_code, 200)
+        self.assertEqual(response.content, 'Howdy, Slartibartfast')
+
+    def test_argument_with_space_post(self):
+        "Post for a view that has a string argument that requires escaping"
+        response = self.client.post(reverse('arg_view', args=['Arthur Dent']))
+        self.assertEqual(response.status_code, 200)
+        self.assertEqual(response.content, 'Hi, Arthur')
+
+
Index: tests/regressiontests/test_client_regress/urls.py
===================================================================
--- tests/regressiontests/test_client_regress/urls.py	(revision 7254)
+++ tests/regressiontests/test_client_regress/urls.py	(working copy)
@@ -5,5 +5,6 @@
     (r'^no_template_view/$', views.no_template_view),
     (r'^file_upload/$', views.file_upload_view),
     (r'^get_view/$', views.get_view),
+    url(r'^arg_view/(?P<name>.+)/$', views.view_with_argument, name='arg_view'),
     (r'^login_protected_redirect_view/$', views.login_protected_redirect_view)
 )
Index: tests/regressiontests/test_client_regress/views.py
===================================================================
--- tests/regressiontests/test_client_regress/views.py	(revision 7254)
+++ tests/regressiontests/test_client_regress/views.py	(working copy)
@@ -1,7 +1,5 @@
 from django.contrib.auth.decorators import login_required
-from django.core.mail import EmailMessage, SMTPConnection
 from django.http import HttpResponse, HttpResponseRedirect, HttpResponseServerError
-from django.shortcuts import render_to_response
 
 def no_template_view(request):
     "A simple view that expects a GET request, and returns a rendered template"
@@ -20,10 +18,22 @@
         return HttpResponseServerError()
 
 def get_view(request):
-    "A simple login protected view"    
+    "A simple login protected view"
     return HttpResponse("Hello world")
 get_view = login_required(get_view)
 
+def view_with_argument(request, name):
+    """A view that takes a string argument
+
+    The purpose of this view is to check that if a space is provided in
+    the argument, the test framework unescapes the %20 before passing
+    the value to the view.
+    """
+    if name == 'Arthur Dent':
+        return HttpResponse('Hi, Arthur')
+    else:
+        return HttpResponse('Howdy, %s' % name)
+
 def login_protected_redirect_view(request):
     "A view that redirects all requests to the GET view"
     return HttpResponseRedirect('/test_client_regress/get_view/')
