      loader.template_source_loaders = getattr(loader, RESTORE_LOADERS_ATTR)
      delattr(loader, RESTORE_LOADERS_ATTR)
  
  
  class OverrideSettingsHolder(UserSettingsHolder):
      """
      A custom setting holder that sends a signal upon change.
      """
      def __setattr__(self, name, value):
          UserSettingsHolder.__setattr__(self, name, value)
          setting_changed.send(sender=self.__class__, setting=name, value=value)
  
  
  class override_settings(object):
      """
      Acts as either a decorator, or a context manager. If it's a decorator it
      takes a function and returns a wrapped function. If it's a contextmanager
      it's used with the ``with`` statement. In either event entering/exiting
 
</s> remove Sent when some :ref:`settings are overridden <overriding-settings>` with the
 </s> add This signal is sent when the value of a setting is changed through the </s> remove     The new setting value.
 </s> add     The value of the setting after the change. For settings that initially
    don't exist, in the "teardown" phase, ``value`` is ``None``. </s> remove     Same as sender
 </s> add     The name of the setting. </s> remove         override = OverrideSettingsHolder(settings._wrapped)
 </s> add         override = UserSettingsHolder(settings._wrapped)
      loader.template_source_loaders = getattr(loader, RESTORE_LOADERS_ATTR)
      delattr(loader, RESTORE_LOADERS_ATTR)
  
  









  class override_settings(object):
      """
      Acts as either a decorator, or a context manager. If it's a decorator it
      takes a function and returns a wrapped function. If it's a contextmanager
      it's used with the ``with`` statement. In either event entering/exiting
keep keep keep keep replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Fixed #17895 -- Made override_settings send the setting_changed signal both when a setting is overridden and when it's restored.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@17708 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/test/utils.py