mirror of
https://github.com/django/django.git
synced 2025-08-31 07:47:37 +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
|
@ -1182,7 +1182,7 @@ easy::
|
|||
class MiddlewareTestCase(TestCase):
|
||||
|
||||
def test_cache_middleware(self):
|
||||
with self.modify_settings(MIDDLEWARE_CLASSES={
|
||||
with self.modify_settings(MIDDLEWARE={
|
||||
'append': 'django.middleware.cache.FetchFromCacheMiddleware',
|
||||
'prepend': 'django.middleware.cache.UpdateCacheMiddleware',
|
||||
'remove': [
|
||||
|
@ -1233,7 +1233,7 @@ decorator::
|
|||
|
||||
class MiddlewareTestCase(TestCase):
|
||||
|
||||
@modify_settings(MIDDLEWARE_CLASSES={
|
||||
@modify_settings(MIDDLEWARE={
|
||||
'append': 'django.middleware.cache.FetchFromCacheMiddleware',
|
||||
'prepend': 'django.middleware.cache.UpdateCacheMiddleware',
|
||||
})
|
||||
|
@ -1245,7 +1245,7 @@ The decorator can also be applied to test case classes::
|
|||
|
||||
from django.test import TestCase, modify_settings
|
||||
|
||||
@modify_settings(MIDDLEWARE_CLASSES={
|
||||
@modify_settings(MIDDLEWARE={
|
||||
'append': 'django.middleware.cache.FetchFromCacheMiddleware',
|
||||
'prepend': 'django.middleware.cache.UpdateCacheMiddleware',
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue