Changeset 6991 for django/trunk/tests/regressiontests/middleware
- Timestamp:
- 01/02/08 20:14:29 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/tests/regressiontests/middleware/tests.py
r6852 r6991 1 1 # -*- coding: utf-8 -*- 2 2 3 import unittest 4 5 from django.test import TestCase 3 from django.test import TestCase 6 4 from django.http import HttpRequest 7 5 from django.middleware.common import CommonMiddleware … … 20 18 def test_append_slash_have_slash(self): 21 19 """ 22 tests that urls with slashes go unmolested20 Tests that URLs with slashes go unmolested. 23 21 """ 24 22 settings.APPEND_SLASH = True … … 28 26 def test_append_slash_slashless_resource(self): 29 27 """ 30 tests that matches to explicit slashless urls go unmolested28 Tests that matches to explicit slashless URLs go unmolested. 31 29 """ 32 30 settings.APPEND_SLASH = True … … 36 34 def test_append_slash_slashless_unknown(self): 37 35 """ 38 tests that APPEND_SLASH doesn't redirect to unknown resources36 Tests that APPEND_SLASH doesn't redirect to unknown resources. 39 37 """ 40 38 settings.APPEND_SLASH = True … … 44 42 def test_append_slash_redirect(self): 45 43 """ 46 tests that APPEND_SLASH redirects slashless urls to a valid pattern44 Tests that APPEND_SLASH redirects slashless URLs to a valid pattern. 47 45 """ 48 46 settings.APPEND_SLASH = True … … 54 52 def test_append_slash_no_redirect_on_POST_in_DEBUG(self): 55 53 """ 56 tests that while in debug mode, an exception is raised with a warning57 when a failed attempt is made to POST to an urlwhich would normally be58 redirected to a slashed version 54 Tests that while in debug mode, an exception is raised with a warning 55 when a failed attempt is made to POST to an URL which would normally be 56 redirected to a slashed version. 59 57 """ 60 58 settings.APPEND_SLASH = True … … 70 68 except RuntimeError, e: 71 69 self.assertTrue('end in a slash' in str(e)) 70 settings.DEBUG = False 72 71 73 72 def test_append_slash_disabled(self): 74 73 """ 75 tests disabling append slash functionality74 Tests disabling append slash functionality. 76 75 """ 77 76 settings.APPEND_SLASH = False … … 81 80 def test_append_slash_quoted(self): 82 81 """ 83 tests that urls which require quoting are redirected to their slash84 version ok 82 Tests that URLs which require quoting are redirected to their slash 83 version ok. 85 84 """ 86 85 settings.APPEND_SLASH = True … … 91 90 r['Location'], 92 91 'http://testserver/middleware/needsquoting%23/') 93
