'URLs which require quoting should be redirected to their slash version.'

@override_settings(APPEND_SLASH=True)
def test_append_slash_quoted_custom_urlconf(self):

    request = self.rf.get(quote('/customurlconf/needsquoting#'))
    request.urlconf = 'middleware.extra_urls'
    response = HttpResponseNotFound()
    r = CommonMiddleware().process_response(request, response)
    self.assertIsNotNone(r, 'CommonMiddleware    failed    to    return    APPEND_SLASH    redirect    using    request.urlconf')
    self.assertEqual(r.status_code, 301)
    self.assertEqual(r.url, '/customurlconf/needsquoting%23/')
