      def _dec(*args, **kwargs):
          if args:
              args = list(args)
              args[0] = force_unicode(args[0])
          if isinstance(args[0], SafeData) and getattr(func, 'is_safe', False):
              return mark_safe(func(*args, **kwargs))
          return func(*args, **kwargs)
  
      # Include a reference to the real function (used to check original
      # arguments by the template parser).
      _dec._decorated_function = getattr(func, '_decorated_function', func)
 
</s> remove             'basic-syntax08': (r'{% autoescape on %}{{ var|default_if_none:" endquote\" hah" }}{% endautoescape %}', {"var": None}, ' endquote" hah'),
 </s> add             'autoescape-tag08': (r'{% autoescape on %}{{ var|default_if_none:" endquote\" hah" }}{% endautoescape %}', {"var": None}, ' endquote" hah'),

            # Objects which return safe strings as their __unicode__ method
            # won't get double-escaped.
            'autoescape-tag09': (r'{{ unsafe }}', {'unsafe': filters.UnsafeClass()}, 'you &amp; me'),
            'autoescape-tag10': (r'{{ safe }}', {'safe': filters.SafeClass()}, 'you &gt; me'),
            if isinstance(args[0], SafeData) and getattr(func, 'is_safe', False):
                return mark_safe(func(*args, **kwargs))
      def _dec(*args, **kwargs):
          if args:
              args = list(args)
              args[0] = force_unicode(args[0])
            if isinstance(args[0], SafeData) and getattr(func, 'is_safe', False):
                return mark_safe(func(*args, **kwargs))
            if isinstance(args[0], SafeData) and getattr(func, 'is_safe', False):
                return mark_safe(func(*args, **kwargs))
          return func(*args, **kwargs)
  
      # Include a reference to the real function (used to check original
      # arguments by the template parser).
      _dec._decorated_function = getattr(func, '_decorated_function', func)
keep keep keep keep replace replace keep keep keep keep keep
 Added tests and a small optimisation for [6721]. Thanks SmileyChris. Fixed #6049


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6729 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/template/defaultfilters.py