Ticket #16507: 16507.diff
File 16507.diff, 1.5 KB (added by , 13 years ago) |
---|
-
django/contrib/messages/tests/base.py
1 1 from django import http 2 2 from django.test import TestCase 3 from django.test.utils import override_settings 3 4 from django.conf import settings 4 5 from django.utils.translation import ugettext_lazy 5 6 from django.utils.unittest import skipIf … … 55 56 self._message_storage = settings.MESSAGE_STORAGE 56 57 settings.MESSAGE_STORAGE = '%s.%s' % (self.storage_class.__module__, 57 58 self.storage_class.__name__) 58 self.old_TEMPLATE_DIRS = settings.TEMPLATE_DIRS59 settings.TEMPLATE_DIRS = ()60 59 61 60 def tearDown(self): 62 61 for setting in self.restore_settings: … … 67 66 self._template_context_processors 68 67 settings.INSTALLED_APPS = self._installed_apps 69 68 settings.MESSAGE_STORAGE = self._message_storage 70 settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS71 69 72 70 def restore_setting(self, setting): 73 71 if setting in self._remembered_settings: … … 392 390 # Ensure the level tags constant is put back like we found it. 393 391 self.restore_setting('MESSAGE_TAGS') 394 392 base.LEVEL_TAGS = utils.get_level_tags() 393 394 395 BaseTest = override_settings(DEBUG_PROPAGATE_EXCEPTIONS=True, 396 TEMPLATE_DIRS=())(BaseTest)