Fixed #15016 -- Ensured that the messages tests are isolated from local template directories. Thanks to Gabriel Hurley for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15407 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2011-02-04 14:33:11 +00:00
parent 4306501da7
commit 514c0b5eb4
1 changed files with 3 additions and 0 deletions

View File

@ -58,6 +58,8 @@ class BaseTest(TestCase):
self._message_storage = settings.MESSAGE_STORAGE
settings.MESSAGE_STORAGE = '%s.%s' % (self.storage_class.__module__,
self.storage_class.__name__)
self.old_TEMPLATE_DIRS = settings.TEMPLATE_DIRS
settings.TEMPLATE_DIRS = ()
self.save_warnings_state()
warnings.filterwarnings('ignore', category=DeprecationWarning,
module='django.contrib.auth.models')
@ -71,6 +73,7 @@ class BaseTest(TestCase):
self._template_context_processors
settings.INSTALLED_APPS = self._installed_apps
settings.MESSAGE_STORAGE = self._message_storage
settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
self.restore_warnings_state()
def restore_setting(self, setting):