  from django.utils.safestring import mark_safe
  
  # RESULT SYNTAX --
  # 'template_name': ('template contents', 'context dict',
  #                   'expected string output' or Exception class)
  def get_filter_tests():
      now = datetime.now()
      now_tz = datetime.now(LocalTimezone(now))
 
</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'), </s> remove         if isinstance(args[0], SafeData) and getattr(func, 'is_safe', False):
            return mark_safe(func(*args, **kwargs))
 </s> add             if isinstance(args[0], SafeData) and getattr(func, 'is_safe', False):
                return mark_safe(func(*args, **kwargs))
# These two classes are used to test auto-escaping of __unicode__ output.
class UnsafeClass:
    def __unicode__(self):
        return u'you & me'

class SafeClass:
    def __unicode__(self):
        return mark_safe(u'you &gt; me')

  from django.utils.safestring import mark_safe
  
# These two classes are used to test auto-escaping of __unicode__ output.
class UnsafeClass:
    def __unicode__(self):
        return u'you & me'

class SafeClass:
    def __unicode__(self):
        return mark_safe(u'you &gt; me')

  # RESULT SYNTAX --
  # 'template_name': ('template contents', 'context dict',
  #                   'expected string output' or Exception class)
  def get_filter_tests():
      now = datetime.now()
      now_tz = datetime.now(LocalTimezone(now))
keep add keep 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 
tests/regressiontests/templates/filters.py