Ticket #16507: 16507.diff

File 16507.diff, 1.5 KB (added by aaugustin, 4 years ago)
  • django/contrib/messages/tests/base.py

     
    11from django import http
    22from django.test import TestCase
     3from django.test.utils import override_settings
    34from django.conf import settings
    45from django.utils.translation import ugettext_lazy
    56from django.utils.unittest import skipIf
     
    5556        self._message_storage = settings.MESSAGE_STORAGE
    5657        settings.MESSAGE_STORAGE = '%s.%s' % (self.storage_class.__module__,
    5758                                              self.storage_class.__name__)
    58         self.old_TEMPLATE_DIRS = settings.TEMPLATE_DIRS
    59         settings.TEMPLATE_DIRS = ()
    6059
    6160    def tearDown(self):
    6261        for setting in self.restore_settings:
     
    6766           self._template_context_processors
    6867        settings.INSTALLED_APPS = self._installed_apps
    6968        settings.MESSAGE_STORAGE = self._message_storage
    70         settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
    7169
    7270    def restore_setting(self, setting):
    7371        if setting in self._remembered_settings:
     
    392390            # Ensure the level tags constant is put back like we found it.
    393391            self.restore_setting('MESSAGE_TAGS')
    394392            base.LEVEL_TAGS = utils.get_level_tags()
     393
     394
     395BaseTest = override_settings(DEBUG_PROPAGATE_EXCEPTIONS=True,
     396                             TEMPLATE_DIRS=())(BaseTest)
Back to Top