diff --git a/django/contrib/auth/tests/context_processors.py b/django/contrib/auth/tests/context_processors.py
index 49172c6..e6dd353 100644
a
|
b
|
|
1 | 1 | import os |
2 | 2 | |
3 | | from django.conf import settings |
| 3 | from django.conf import settings, global_settings |
4 | 4 | from django.contrib.auth import authenticate |
5 | 5 | from django.db.models import Q |
6 | 6 | from django.test import TestCase |
| 7 | from django.test.utils import override_settings |
7 | 8 | |
8 | 9 | |
9 | 10 | class AuthContextProcessorTests(TestCase): |
… |
… |
class AuthContextProcessorTests(TestCase):
|
13 | 14 | urls = 'django.contrib.auth.tests.urls' |
14 | 15 | fixtures = ['context-processors-users.xml'] |
15 | 16 | |
16 | | def setUp(self): |
17 | | self.old_TEMPLATE_DIRS = settings.TEMPLATE_DIRS |
18 | | settings.TEMPLATE_DIRS = ( |
19 | | os.path.join(os.path.dirname(__file__), 'templates'), |
20 | | ) |
21 | | |
22 | | def tearDown(self): |
23 | | settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS |
24 | | |
| 17 | @override_settings(MIDDLEWARE_CLASSES=global_settings.MIDDLEWARE_CLASSES) |
25 | 18 | def test_session_not_accessed(self): |
26 | 19 | """ |
27 | 20 | Tests that the session is not accessed simply by including |
… |
… |
class AuthContextProcessorTests(TestCase):
|
30 | 23 | response = self.client.get('/auth_processor_no_attr_access/') |
31 | 24 | self.assertContains(response, "Session not accessed") |
32 | 25 | |
| 26 | @override_settings(MIDDLEWARE_CLASSES=global_settings.MIDDLEWARE_CLASSES) |
33 | 27 | def test_session_is_accessed(self): |
34 | 28 | """ |
35 | 29 | Tests that the session is accessed if the auth context processor |
… |
… |
class AuthContextProcessorTests(TestCase):
|
86 | 80 | # See bug #12060 |
87 | 81 | self.assertEqual(response.context['user'], user) |
88 | 82 | self.assertEqual(user, response.context['user']) |
| 83 | |
| 84 | AuthContextProcessorTests = override_settings( |
| 85 | TEMPLATE_DIRS = ( |
| 86 | os.path.join(os.path.dirname(__file__), 'templates'), |
| 87 | ) |
| 88 | )(AuthContextProcessorTests) |