'Tests that while in debug mode, an exception is raised with a warning
when a failed attempt is made to POST to an URL which would normally be
redirected to a slashed version.'

def test_append_slash_no_redirect_on_POST_in_DEBUG_custom_urlconf(self):

    settings.APPEND_SLASH = True
    settings.DEBUG = True
    request = self._get_request('customurlconf/slash')
    request.urlconf = 'regressiontests.middleware.extra_urls'
    request.method = 'POST'
    self.assertRaises(RuntimeError, CommonMiddleware().process_request, request)
    try:
        CommonMiddleware().process_request(request)
    except RuntimeError as e:
        self.assertTrue(('end    in    a    slash' in str(e)))
    settings.DEBUG = False
