mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #26601 -- Improved middleware per DEP 0005.
Thanks Tim Graham for polishing the patch, updating the tests, and writing documentation. Thanks Carl Meyer for shepherding the DEP.
This commit is contained in:
parent
05c888ffb8
commit
9baf692a58
81 changed files with 900 additions and 1414 deletions
|
@ -26,16 +26,16 @@ class TestStartProjectSettings(TestCase):
|
|||
shutil.copyfile(template_settings_py, test_settings_py)
|
||||
self.addCleanup(os.remove, test_settings_py)
|
||||
|
||||
def test_middleware_classes_headers(self):
|
||||
def test_middleware_headers(self):
|
||||
"""
|
||||
Ensure headers sent by the default MIDDLEWARE_CLASSES do not
|
||||
inadvertently change. For example, we never want "Vary: Cookie" to
|
||||
appear in the list since it prevents the caching of responses.
|
||||
Ensure headers sent by the default MIDDLEWARE don't inadvertently
|
||||
change. For example, we never want "Vary: Cookie" to appear in the list
|
||||
since it prevents the caching of responses.
|
||||
"""
|
||||
from django.conf.project_template.project_name.settings import MIDDLEWARE_CLASSES
|
||||
from django.conf.project_template.project_name.settings import MIDDLEWARE
|
||||
|
||||
with self.settings(
|
||||
MIDDLEWARE_CLASSES=MIDDLEWARE_CLASSES,
|
||||
MIDDLEWARE=MIDDLEWARE,
|
||||
ROOT_URLCONF='project_template.urls',
|
||||
):
|
||||
response = self.client.get('/empty/')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue