diff options
| -rw-r--r-- | tests/context_processors.py | 5 | ||||
| -rw-r--r-- | tests/panels/test_redirects.py | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/tests/context_processors.py b/tests/context_processors.py index 3514639..4c08000 100644 --- a/tests/context_processors.py +++ b/tests/context_processors.py @@ -1,3 +1,2 @@ - -def custom(req): - msg = req.myattr +def custom(request): + request.non_existing_attribute diff --git a/tests/panels/test_redirects.py b/tests/panels/test_redirects.py index 8e63ff0..71d53da 100644 --- a/tests/panels/test_redirects.py +++ b/tests/panels/test_redirects.py @@ -34,9 +34,12 @@ class RedirectsPanelTestCase(BaseTestCase): self.assertContains(response, 'http://somewhere/else/') def test_redirect_breaks_procesor(self): - middlewares = settings.MIDDLEWARE_CLASSES + ['tests.middlewares.CustomMiddleware'] - context_processors = settings.TEMPLATE_CONTEXT_PROCESSORS + \ - ('tests.context_processors.custom',) + middlewares = settings.MIDDLEWARE_CLASSES + [ + 'tests.middlewares.CustomMiddleware', + ] + context_processors = settings.TEMPLATE_CONTEXT_PROCESSORS + ( + 'tests.context_processors.custom', + ) with self.settings(MIDDLEWARE_CLASSES=middlewares, TEMPLATE_CONTEXT_PROCESSORS=context_processors): |
