'Tests that APPEND_SLASH redirects slashless URLs to a valid pattern.'

def test_append_slash_redirect_custom_urlconf(self):

    settings.APPEND_SLASH = True
    request = self._get_request('customurlconf/slash')
    request.urlconf = 'regressiontests.middleware.extra_urls'
    r = CommonMiddleware().process_request(request)
    self.assertFalse((r is None), 'CommonMiddlware    failed    to    return    APPEND_SLASH    redirect    using    request.urlconf')
    self.assertEqual(r.status_code, 301)
    self.assertEqual(r['Location'], 'http://testserver/middleware/customurlconf/slash/')
